From 4e573145da8888d04a974bb16809396cd81e8c8d Mon Sep 17 00:00:00 2001 From: lionelllohcd Date: Mon, 30 May 2022 18:59:47 -0700 Subject: [PATCH 1/2] Pass --out-dir for run-pass tests in Compiletest --- src/tools/compiletest/src/runtest.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 494c8d771b07b..def069b985990 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1905,13 +1905,15 @@ impl<'test> TestCx<'test> { match output_file { TargetLocation::ThisFile(path) => { rustc.arg("-o").arg(path); + rustc.arg("--out-dir").arg(&self.config.build_base); + } 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); + rustc.arg("--out-dir").arg(&self.config.build_base); } } } From 6a1933dd344fb9d3d1fb50a808f3bf2b9344f05a Mon Sep 17 00:00:00 2001 From: lionelllohcd Date: Mon, 30 May 2022 19:57:11 -0700 Subject: [PATCH 2/2] format code --- src/tools/compiletest/src/runtest.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index def069b985990..62926980be60a 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1906,7 +1906,6 @@ impl<'test> TestCx<'test> { TargetLocation::ThisFile(path) => { rustc.arg("-o").arg(path); rustc.arg("--out-dir").arg(&self.config.build_base); - } TargetLocation::ThisDirectory(path) => { if is_rustdoc {