Skip to content

Commit 62e2b2f

Browse files
committed
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
2 parents 0cb9bc5 + 7070124 commit 62e2b2f

File tree

371 files changed

+2769
-2004
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

371 files changed

+2769
-2004
lines changed

mk/tests.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,6 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) = \
622622
--rustc-path $$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
623623
--rustdoc-path $$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
624624
--llvm-filecheck $(CFG_LLVM_INST_DIR_$(CFG_BUILD))/bin/FileCheck \
625-
--aux-base $$(S)src/test/auxiliary/ \
626625
--stage-id stage$(1)-$(2) \
627626
--target $(2) \
628627
--host $(3) \

src/bootstrap/build/check.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ pub fn compiletest(build: &Build,
7070
cmd.arg("--rustc-path").arg(build.compiler_path(compiler));
7171
cmd.arg("--rustdoc-path").arg(build.rustdoc(compiler));
7272
cmd.arg("--src-base").arg(build.src.join("src/test").join(suite));
73-
cmd.arg("--aux-base").arg(build.src.join("src/test/auxiliary"));
7473
cmd.arg("--build-base").arg(testdir(build, compiler.host).join(suite));
7574
cmd.arg("--stage-id").arg(format!("stage{}-{}", compiler.stage, target));
7675
cmd.arg("--mode").arg(mode);
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![crate_type = "lib"]
12+
13+
struct Struct(u32);
14+
15+
#[inline(never)]
16+
pub fn foo<T>(x: T) -> (T, u32, i8) {
17+
let (x, Struct(y)) = bar(x);
18+
(x, y, 2)
19+
}
20+
21+
#[inline(never)]
22+
fn bar<T>(x: T) -> (T, Struct) {
23+
let _ = not_exported_and_not_generic(0);
24+
(x, Struct(1))
25+
}
26+
27+
// These should not contribute to the codegen items of other crates.
28+
#[inline(never)]
29+
pub fn exported_but_not_generic(x: i32) -> i64 {
30+
x as i64
31+
}
32+
33+
#[inline(never)]
34+
fn not_exported_and_not_generic(x: u32) -> u64 {
35+
x as u64
36+
}
37+

0 commit comments

Comments
 (0)