Skip to content

Commit

Permalink
Include path in stamp hash for debuginfo tests
Browse files Browse the repository at this point in the history
The debuginfo tests are exposed to the environment in a couple of
ways: the path to the gdb executable matters, as does the Python path
used when loading lldb.

This patch incorporates these paths into the hash that is written to
the stamp file, so that changing the path will cause the tests to be
re-run.
  • Loading branch information
tromey committed Sep 25, 2018
1 parent ae36663 commit e6ea19d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,19 @@ pub fn run(config: Config, testpaths: &TestPaths, revision: Option<&str>) {
pub fn compute_stamp_hash(config: &Config) -> String {
let mut hash = DefaultHasher::new();
config.stage_id.hash(&mut hash);
match config.mode {
DebugInfoGdb => match config.gdb {
None => env::var_os("PATH").hash(&mut hash),
Some(ref s) if s.is_empty() => env::var_os("PATH").hash(&mut hash),
Some(ref s) => s.hash(&mut hash),
},
DebugInfoLldb => {
env::var_os("PATH").hash(&mut hash);
env::var_os("PYTHONPATH").hash(&mut hash);
},

_ => {},
};
format!("{:x}", hash.finish())
}

Expand Down

0 comments on commit e6ea19d

Please # to comment.