Auto merge of #33228 - nikomatsakis:compiletest-gut, r=acrichto
Move auxiliary directories to live with the tests This is a step for enabling testing of cross-crate incremental compilation. The idea is that instead of having a central auxiliary directory, when you have a `// aux-build:foo.rs` annotation in the test `run-pass/bar.rs`, it will look in (e.g.) `run-pass/aux/foo.rs`. In general, it looks for an `aux` directory in the same directory as the test. We also ignore the `aux` directories when enumerating the set of tests. As part of this PR, also refactor `runtest.rs` to use methods on a context, which means we can stop passing around context everywhere. r? @alexcrichton
This commit is contained in:
commit
62e2b2fb7a
@ -622,7 +622,6 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) = \
|
||||
--rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
|
||||
--rustdoc-path $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
|
||||
--llvm-filecheck $(CFG_LLVM_INST_DIR_$(CFG_BUILD))/bin/FileCheck \
|
||||
--aux-base $$(S)src/test/auxiliary/ \
|
||||
--stage-id stage$(1)-$(2) \
|
||||
--target $(2) \
|
||||
--host $(3) \
|
||||
|
@ -70,7 +70,6 @@ pub fn compiletest(build: &Build,
|
||||
cmd.arg("--rustc-path").arg(build.compiler_path(compiler));
|
||||
cmd.arg("--rustdoc-path").arg(build.rustdoc(compiler));
|
||||
cmd.arg("--src-base").arg(build.src.join("src/test").join(suite));
|
||||
cmd.arg("--aux-base").arg(build.src.join("src/test/auxiliary"));
|
||||
cmd.arg("--build-base").arg(testdir(build, compiler.host).join(suite));
|
||||
cmd.arg("--stage-id").arg(format!("stage{}-{}", compiler.stage, target));
|
||||
cmd.arg("--mode").arg(mode);
|
||||
|
@ -0,0 +1,37 @@
|
||||
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
struct Struct(u32);
|
||||
|
||||
#[inline(never)]
|
||||
pub fn foo<T>(x: T) -> (T, u32, i8) {
|
||||
let (x, Struct(y)) = bar(x);
|
||||
(x, y, 2)
|
||||
}
|
||||
|
||||
#[inline(never)]
|
||||
fn bar<T>(x: T) -> (T, Struct) {
|
||||
let _ = not_exported_and_not_generic(0);
|
||||
(x, Struct(1))
|
||||
}
|
||||
|
||||
// These should not contribute to the codegen items of other crates.
|
||||
#[inline(never)]
|
||||
pub fn exported_but_not_generic(x: i32) -> i64 {
|
||||
x as i64
|
||||
}
|
||||
|
||||
#[inline(never)]
|
||||
fn not_exported_and_not_generic(x: u32) -> u64 {
|
||||
x as u64
|
||||
}
|
||||
|
@ -8,6 +8,8 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![no_std]
|
||||
|
||||
pub fn foo() {}
|
||||
#![crate_type = "dylib"]
|
||||
#[macro_export]
|
||||
macro_rules! reexported {
|
||||
() => ( 3 )
|
||||
}
|
41
src/test/compile-fail/auxiliary/use_from_trait_xc.rs
Normal file
41
src/test/compile-fail/auxiliary/use_from_trait_xc.rs
Normal file
@ -0,0 +1,41 @@
|
||||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(associated_consts)]
|
||||
|
||||
pub use self::sub::{Bar, Baz};
|
||||
|
||||
pub trait Trait {
|
||||
fn foo(&self);
|
||||
type Assoc;
|
||||
const CONST: u32;
|
||||
}
|
||||
|
||||
struct Foo;
|
||||
|
||||
impl Foo {
|
||||
pub fn new() {}
|
||||
|
||||
pub const C: u32 = 0;
|
||||
}
|
||||
|
||||
mod sub {
|
||||
pub struct Bar;
|
||||
|
||||
impl Bar {
|
||||
pub fn new() {}
|
||||
}
|
||||
|
||||
pub enum Baz {}
|
||||
|
||||
impl Baz {
|
||||
pub fn new() {}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user