Skip to content

Commit c986f48

Browse files
committed
coverage: Give each coverage test mode a separate output directory
When multiple test modes share the same test directory, this will allow them to avoid interfering with each others' files and timestamps.
1 parent ee33712 commit c986f48

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/tools/compiletest/src/common.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,9 +696,16 @@ pub fn output_testname_unique(
696696
testpaths: &TestPaths,
697697
revision: Option<&str>,
698698
) -> PathBuf {
699+
// Coverage tests use the same test files for multiple test modes,
700+
// so each mode should have a separate output directory.
701+
let coverage_mode = match config.mode {
702+
mode @ (CoverageMap | RunCoverage) => mode.to_str(),
703+
_ => "",
704+
};
699705
let mode = config.compare_mode.as_ref().map_or("", |m| m.to_str());
700706
let debugger = config.debugger.as_ref().map_or("", |m| m.to_str());
701707
PathBuf::from(&testpaths.file.file_stem().unwrap())
708+
.with_extra_extension(coverage_mode)
702709
.with_extra_extension(revision.unwrap_or(""))
703710
.with_extra_extension(mode)
704711
.with_extra_extension(debugger)

0 commit comments

Comments
 (0)