Skip to content

Commit

Permalink
Rollup merge of rust-lang#105246 - JakobDegen:run-mir-tests, r=jyn514
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthiaskrgr authored Dec 5, 2022
2 parents 48f8a92 + 01a4898 commit 15b3747
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 15b3747

Please sign in to comment.