1
Fork 0

compiletest: Avoid double negation in ignore condition

This commit is contained in:
Tomasz Miąsko 2019-11-13 00:00:00 +00:00
parent 8c6e297816
commit 1ac470f70c

View file

@ -731,7 +731,8 @@ fn make_test(config: &Config, testpaths: &TestPaths, inputs: &Stamp) -> Vec<test
&& config.target.contains("emscripten")) && config.target.contains("emscripten"))
|| (config.mode == DebugInfoGdb && !early_props.ignore.can_run_gdb()) || (config.mode == DebugInfoGdb && !early_props.ignore.can_run_gdb())
|| (config.mode == DebugInfoLldb && !early_props.ignore.can_run_lldb()) || (config.mode == DebugInfoLldb && !early_props.ignore.can_run_lldb())
|| !is_outdated( // Ignore tests that already run and are up to date with respect to inputs.
|| is_up_to_date(
config, config,
testpaths, testpaths,
&early_props, &early_props,
@ -756,7 +757,7 @@ fn stamp(config: &Config, testpaths: &TestPaths, revision: Option<&str>) -> Path
output_base_dir(config, testpaths, revision).join("stamp") output_base_dir(config, testpaths, revision).join("stamp")
} }
fn is_outdated( fn is_up_to_date(
config: &Config, config: &Config,
testpaths: &TestPaths, testpaths: &TestPaths,
props: &EarlyProps, props: &EarlyProps,
@ -768,11 +769,11 @@ fn is_outdated(
let contents = match fs::read_to_string(&stamp_name) { let contents = match fs::read_to_string(&stamp_name) {
Ok(f) => f, Ok(f) => f,
Err(ref e) if e.kind() == ErrorKind::InvalidData => panic!("Can't read stamp contents"), Err(ref e) if e.kind() == ErrorKind::InvalidData => panic!("Can't read stamp contents"),
Err(_) => return true, Err(_) => return false,
}; };
let expected_hash = runtest::compute_stamp_hash(config); let expected_hash = runtest::compute_stamp_hash(config);
if contents != expected_hash { if contents != expected_hash {
return true; return false;
} }
// Check timestamps. // Check timestamps.
@ -793,7 +794,7 @@ fn is_outdated(
inputs.add_path(path); inputs.add_path(path);
} }
inputs > Stamp::from_path(&stamp_name) inputs < Stamp::from_path(&stamp_name)
} }
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]