about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev+love@gmail.com>2022-12-06 12:48:51 +0900
committerGitHub <noreply@github.com>2022-12-06 12:48:51 +0900
commitef1f3bfd3910c663670519f15bd20b92f03efcf5 (patch)
treeaf3c5116a980cb65b4928cd6c0b89c30cd35eb55 /src
parentaa0831092bd78333580f4d3608046a4e4fc2aa39 (diff)
parent01a48982106fbcf4be448ad560d51fd91ace2b92 (diff)
downloadrust-ef1f3bfd3910c663670519f15bd20b92f03efcf5.tar.gz
rust-ef1f3bfd3910c663670519f15bd20b92f03efcf5.zip
Rollup merge of #105246 - JakobDegen:run-mir-tests, r=jyn514
Fix --pass in compiletest

This makes `x test src/test/mir-opt --pass run` actually do the thing it says it does. The resulting tests do not pass, I'll fix that in a follow up.
Diffstat (limited to 'src')
-rw-r--r--src/tools/compiletest/src/header.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index 0d9a629e179..64d97e91442 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/header.rs
@@ -260,9 +260,9 @@ impl TestProps {
         props.load_from(testfile, cfg, config);
 
         match (props.pass_mode, props.fail_mode) {
-            (None, None) => props.fail_mode = Some(FailMode::Check),
-            (Some(_), None) | (None, Some(_)) => {}
+            (None, None) if config.mode == Mode::Ui => props.fail_mode = Some(FailMode::Check),
             (Some(_), Some(_)) => panic!("cannot use a *-fail and *-pass mode together"),
+            _ => {}
         }
 
         props
@@ -522,8 +522,8 @@ impl TestProps {
     }
 
     pub fn pass_mode(&self, config: &Config) -> Option<PassMode> {
-        if !self.ignore_pass && self.fail_mode.is_none() && config.mode == Mode::Ui {
-            if let (mode @ Some(_), Some(_)) = (config.force_pass_mode, self.pass_mode) {
+        if !self.ignore_pass && self.fail_mode.is_none() {
+            if let mode @ Some(_) = config.force_pass_mode {
                 return mode;
             }
         }