]> git.lizzy.rs Git - rust.git/commitdiff
compiletest: don't overwrite failure-status if it was previously set
authorQuietMisdreavus <grey@quietmisdreavus.net>
Fri, 20 Jul 2018 18:25:44 +0000 (13:25 -0500)
committerQuietMisdreavus <grey@quietmisdreavus.net>
Fri, 20 Jul 2018 18:25:44 +0000 (13:25 -0500)
src/tools/compiletest/src/header.rs

index edab2a5ec034c15511349c0c86635c4a535c8805..eeb280e1de36cbd62f54dc9c981ba78bd96c0089 100644 (file)
@@ -392,11 +392,6 @@ fn load_from(&mut self, testfile: &Path, cfg: Option<&str>, config: &Config) {
 
             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 @@ fn load_from(&mut self, testfile: &Path, cfg: Option<&str>, config: &Config) {
             }
         });
 
+        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() {