Skip to content

Commit f38bf53

Browse files
Take revision into account in src/test/ui incremental tests
1 parent e5e4eef commit f38bf53

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/tools/compiletest/src/common.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,6 @@ pub fn output_base_name(config: &Config, testpaths: &TestPaths, revision: Option
617617

618618
/// Absolute path to the directory to use for incremental compilation. Example:
619619
/// /path/to/build/host-triple/test/ui/relative/testname.mode/testname.inc
620-
pub fn incremental_dir(config: &Config, testpaths: &TestPaths) -> PathBuf {
621-
output_base_name(config, testpaths, None).with_extension("inc")
620+
pub fn incremental_dir(config: &Config, testpaths: &TestPaths, revision: Option<&str>) -> PathBuf {
621+
output_base_name(config, testpaths, revision).with_extension("inc")
622622
}

src/tools/compiletest/src/runtest.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,12 @@ pub fn run(config: Config, testpaths: &TestPaths, revision: Option<&str>) {
117117
}
118118
debug!("running {:?}", testpaths.file.display());
119119
let mut props = TestProps::from_file(&testpaths.file, revision, &config);
120+
121+
// For non-incremental (i.e. regular UI) tests, the incremental directory
122+
// takes into account the revision name, since the revisions are independent
123+
// of each other and can race.
120124
if props.incremental {
121-
props.incremental_dir = Some(incremental_dir(&config, testpaths));
125+
props.incremental_dir = Some(incremental_dir(&config, testpaths, revision));
122126
}
123127

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

0 commit comments

Comments
 (0)