Skip to content

Commit 1ac470f

Browse files
committed
compiletest: Avoid double negation in ignore condition
1 parent 8c6e297 commit 1ac470f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/tools/compiletest/src/main.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,8 @@ fn make_test(config: &Config, testpaths: &TestPaths, inputs: &Stamp) -> Vec<test
731731
&& config.target.contains("emscripten"))
732732
|| (config.mode == DebugInfoGdb && !early_props.ignore.can_run_gdb())
733733
|| (config.mode == DebugInfoLldb && !early_props.ignore.can_run_lldb())
734-
|| !is_outdated(
734+
// Ignore tests that already run and are up to date with respect to inputs.
735+
|| is_up_to_date(
735736
config,
736737
testpaths,
737738
&early_props,
@@ -756,7 +757,7 @@ fn stamp(config: &Config, testpaths: &TestPaths, revision: Option<&str>) -> Path
756757
output_base_dir(config, testpaths, revision).join("stamp")
757758
}
758759

759-
fn is_outdated(
760+
fn is_up_to_date(
760761
config: &Config,
761762
testpaths: &TestPaths,
762763
props: &EarlyProps,
@@ -768,11 +769,11 @@ fn is_outdated(
768769
let contents = match fs::read_to_string(&stamp_name) {
769770
Ok(f) => f,
770771
Err(ref e) if e.kind() == ErrorKind::InvalidData => panic!("Can't read stamp contents"),
771-
Err(_) => return true,
772+
Err(_) => return false,
772773
};
773774
let expected_hash = runtest::compute_stamp_hash(config);
774775
if contents != expected_hash {
775-
return true;
776+
return false;
776777
}
777778

778779
// Check timestamps.
@@ -793,7 +794,7 @@ fn is_outdated(
793794
inputs.add_path(path);
794795
}
795796

796-
inputs > Stamp::from_path(&stamp_name)
797+
inputs < Stamp::from_path(&stamp_name)
797798
}
798799

799800
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]

0 commit comments

Comments
 (0)