From e3bc713e2ef6eef80a0cfd778cbcf887eca8fdcb Mon Sep 17 00:00:00 2001 From: QuietMisdreavus Date: Fri, 20 Jul 2018 13:25:44 -0500 Subject: [PATCH] compiletest: don't overwrite failure-status if it was previously set --- src/tools/compiletest/src/header.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index edab2a5ec034..eeb280e1de36 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -392,11 +392,6 @@ impl TestProps { if let Some(code) = config.parse_failure_status(ln) { self.failure_status = code; - } else { - self.failure_status = match config.mode { - Mode::RunFail => 101, - _ => 1, - }; } if !self.run_rustfix { @@ -404,6 +399,13 @@ impl TestProps { } }); + if self.failure_status == -1 { + self.failure_status = match config.mode { + Mode::RunFail => 101, + _ => 1, + }; + } + for key in &["RUST_TEST_NOCAPTURE", "RUST_TEST_THREADS"] { if let Ok(val) = env::var(key) { if self.exec_env.iter().find(|&&(ref x, _)| x == key).is_none() {