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.
This commit is contained in:
许杰友 Jieyou Xu (Joe) 2024-07-20 09:05:38 +00:00
parent c863525374
commit 2c867d0b5f

View file

@ -760,8 +760,14 @@ pub fn output_testname_unique(
/// test/revision should reside. Example:
/// /path/to/build/host-triple/test/ui/relative/testname.revision.mode/
pub fn output_base_dir(config: &Config, testpaths: &TestPaths, revision: Option<&str>) -> PathBuf {
output_relative_path(config, &testpaths.relative_dir)
.join(output_testname_unique(config, testpaths, revision))
// In run-make tests, constructing a relative path + unique testname causes a double layering
// since revisions are not supported, causing unnecessary nesting.
if config.mode == Mode::RunMake {
output_relative_path(config, &testpaths.relative_dir)
} else {
output_relative_path(config, &testpaths.relative_dir)
.join(output_testname_unique(config, testpaths, revision))
}
}
/// Absolute path to the base filename used as output for the given