about summary refs log tree commit diff
path: root/src/tools/compiletest
diff options
context:
space:
mode:
authorHameer Abbasi <einstein.edison@gmail.com>2021-03-31 15:30:07 +0000
committerHameer Abbasi <einstein.edison@gmail.com>2021-03-31 15:30:07 +0000
commit38b31691a7c6124ae4e48809ee9e083c1ca1f635 (patch)
treef7d0fae257ace5fd2debde6b088ace5720ebe033 /src/tools/compiletest
parentf80b9acf204888585b254e760d13ac4c37af2254 (diff)
downloadrust-38b31691a7c6124ae4e48809ee9e083c1ca1f635.tar.gz
rust-38b31691a7c6124ae4e48809ee9e083c1ca1f635.zip
Fix compiletest to use correct bitwidth stderr files.
Diffstat (limited to 'src/tools/compiletest')
-rw-r--r--src/tools/compiletest/src/runtest.rs19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 1a49b1e7b17..7e6c21b824d 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -3140,8 +3140,14 @@ impl<'test> TestCx<'test> {
         output_kind: TestOutput,
         explicit_format: bool,
     ) -> usize {
+        let stderr_bits = format!("{}.stderr", get_pointer_width(&self.config.target));
         let (stderr_kind, stdout_kind) = match output_kind {
-            TestOutput::Compile => (UI_STDERR, UI_STDOUT),
+            TestOutput::Compile => (
+                {
+                    if self.props.stderr_per_bitwidth { &stderr_bits } else { UI_STDERR }
+                },
+                UI_STDOUT,
+            ),
             TestOutput::Run => (UI_RUN_STDERR, UI_RUN_STDOUT),
         };
 
@@ -3181,15 +3187,12 @@ impl<'test> TestCx<'test> {
         match output_kind {
             TestOutput::Compile => {
                 if !self.props.dont_check_compiler_stdout {
-                    errors += self.compare_output("stdout", &normalized_stdout, &expected_stdout);
+                    errors +=
+                        self.compare_output(stdout_kind, &normalized_stdout, &expected_stdout);
                 }
                 if !self.props.dont_check_compiler_stderr {
-                    let kind = if self.props.stderr_per_bitwidth {
-                        format!("{}.stderr", get_pointer_width(&self.config.target))
-                    } else {
-                        String::from("stderr")
-                    };
-                    errors += self.compare_output(&kind, &normalized_stderr, &expected_stderr);
+                    errors +=
+                        self.compare_output(stderr_kind, &normalized_stderr, &expected_stderr);
                 }
             }
             TestOutput::Run => {