Skip to content

Commit

Permalink
Take revision into account in src/test/ui incremental tests
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Dec 22, 2022
1 parent e5e4eef commit f38bf53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/tools/compiletest/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,6 @@ pub fn output_base_name(config: &Config, testpaths: &TestPaths, revision: Option

/// Absolute path to the directory to use for incremental compilation. Example:
/// /path/to/build/host-triple/test/ui/relative/testname.mode/testname.inc
pub fn incremental_dir(config: &Config, testpaths: &TestPaths) -> PathBuf {
output_base_name(config, testpaths, None).with_extension("inc")
pub fn incremental_dir(config: &Config, testpaths: &TestPaths, revision: Option<&str>) -> PathBuf {
output_base_name(config, testpaths, revision).with_extension("inc")
}
6 changes: 5 additions & 1 deletion src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,12 @@ pub fn run(config: Config, testpaths: &TestPaths, revision: Option<&str>) {
}
debug!("running {:?}", testpaths.file.display());
let mut props = TestProps::from_file(&testpaths.file, revision, &config);

// For non-incremental (i.e. regular UI) tests, the incremental directory
// takes into account the revision name, since the revisions are independent
// of each other and can race.
if props.incremental {
props.incremental_dir = Some(incremental_dir(&config, testpaths));
props.incremental_dir = Some(incremental_dir(&config, testpaths, revision));
}

let cx = TestCx { config: &config, props: &props, testpaths, revision };
Expand Down

0 comments on commit f38bf53

Please sign in to comment.