Skip to content

Commit

Permalink
compiletest/rmake: avoid double test directory for rmake.rs tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jieyouxu committed Jul 20, 2024
1 parent c863525 commit 2c867d0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/tools/compiletest/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2c867d0

Please sign in to comment.