Skip to content

Commit 2c867d0

Browse files
committed
compiletest/rmake: avoid double test directory for rmake.rs tests
This is important for other tests that have various things like modes, revisions and the like. These features are not supported in run-make tests, so we don't need the double layering.
1 parent c863525 commit 2c867d0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/tools/compiletest/src/common.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -760,8 +760,14 @@ pub fn output_testname_unique(
760760
/// test/revision should reside. Example:
761761
/// /path/to/build/host-triple/test/ui/relative/testname.revision.mode/
762762
pub fn output_base_dir(config: &Config, testpaths: &TestPaths, revision: Option<&str>) -> PathBuf {
763-
output_relative_path(config, &testpaths.relative_dir)
764-
.join(output_testname_unique(config, testpaths, revision))
763+
// In run-make tests, constructing a relative path + unique testname causes a double layering
764+
// since revisions are not supported, causing unnecessary nesting.
765+
if config.mode == Mode::RunMake {
766+
output_relative_path(config, &testpaths.relative_dir)
767+
} else {
768+
output_relative_path(config, &testpaths.relative_dir)
769+
.join(output_testname_unique(config, testpaths, revision))
770+
}
765771
}
766772

767773
/// Absolute path to the base filename used as output for the given

0 commit comments

Comments
 (0)