compiletest: only use make_exe_name for tests that end up being executed.
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
warning: due to multiple output types requested, the explicitly specified output file name will be adapted for each output type
|
||||
|
||||
error: any use of this value will cause an error
|
||||
--> $DIR/unused-broken-const.rs:5:18
|
||||
|
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
// ignore-tidy-linelength
|
||||
// compile-flags:--emit=metadata --error-format=json -Z emit-directives
|
||||
// compile-pass
|
||||
//
|
||||
// Normalization is required to eliminated minor path and filename differences
|
||||
// across platforms.
|
||||
// normalize-stderr-test: "metadata file written: .*/emit-directives" -> "metadata file written: .../emit-directives"
|
||||
// normalize-stderr-test: "emit-directives(\.\w*)?/a(\.\w*)?" -> "emit-directives/a"
|
||||
|
||||
// A very basic test for the emission of build directives in JSON output.
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"directive":"metadata file written: .../emit-directives/a"}
|
||||
{"directive":"metadata file written: $TEST_BUILD_DIR/emit-directives/libemit_directives.rmeta"}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
// compile-pass
|
||||
|
||||
// FIXME(eddyb) shorten the name so windows doesn't choke on it.
|
||||
#![crate_name = "trait_test"]
|
||||
|
||||
// Regression test related to #56288. Check that a supertrait projection (of
|
||||
// `Output`) that references `Self` is ok if there is another occurence of
|
||||
// the same supertrait that specifies the projection explicitly, even if
|
||||
|
||||
@@ -1422,10 +1422,21 @@ impl<'test> TestCx<'test> {
|
||||
}
|
||||
|
||||
fn compile_test(&self) -> ProcRes {
|
||||
let mut rustc = self.make_compile_args(
|
||||
&self.testpaths.file,
|
||||
TargetLocation::ThisFile(self.make_exe_name()),
|
||||
);
|
||||
// Only use `make_exe_name` when the test ends up being executed.
|
||||
let will_execute = match self.config.mode {
|
||||
RunPass | Ui => self.should_run_successfully(),
|
||||
Incremental => self.revision.unwrap().starts_with("r"),
|
||||
RunFail | RunPassValgrind | MirOpt |
|
||||
DebugInfoBoth | DebugInfoGdb | DebugInfoLldb => true,
|
||||
_ => false,
|
||||
};
|
||||
let output_file = if will_execute {
|
||||
TargetLocation::ThisFile(self.make_exe_name())
|
||||
} else {
|
||||
TargetLocation::ThisDirectory(self.output_base_dir())
|
||||
};
|
||||
|
||||
let mut rustc = self.make_compile_args(&self.testpaths.file, output_file);
|
||||
|
||||
rustc.arg("-L").arg(&self.aux_output_dir_name());
|
||||
|
||||
@@ -1882,9 +1893,14 @@ impl<'test> TestCx<'test> {
|
||||
rustc.arg("-o").arg(path);
|
||||
}
|
||||
TargetLocation::ThisDirectory(path) => {
|
||||
if is_rustdoc {
|
||||
// `rustdoc` uses `-o` for the output directory.
|
||||
rustc.arg("-o").arg(path);
|
||||
} else {
|
||||
rustc.arg("--out-dir").arg(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
match self.config.compare_mode {
|
||||
Some(CompareMode::Nll) => {
|
||||
|
||||
Reference in New Issue
Block a user