diff options
| author | 许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com> | 2024-07-19 09:45:11 +0000 |
|---|---|---|
| committer | 许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com> | 2024-07-19 14:04:58 +0000 |
| commit | cf5edfe3f92e7b40f984c3e6336f441869901eec (patch) | |
| tree | a8f30f56d6c05b2a5dbbe5cadaced24bc4b3aa48 /src/tools/compiletest | |
| parent | 9f2a660f86bc88112445cea38bcd22e0f30cbd89 (diff) | |
| download | rust-cf5edfe3f92e7b40f984c3e6336f441869901eec.tar.gz rust-cf5edfe3f92e7b40f984c3e6336f441869901eec.zip | |
compiletest/rmake: cleanup rmake exe extension calculation
Diffstat (limited to 'src/tools/compiletest')
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index a38a900b3d8..79c63710070 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -3479,7 +3479,7 @@ impl<'test> TestCx<'test> { // We construct the following directory tree for each rmake.rs test: // ``` - // base_dir/ + // <base_dir>/ // rmake.exe // rmake_out/ // ``` @@ -3597,13 +3597,14 @@ impl<'test> TestCx<'test> { paths }; - // Finally, we need to run the recipe binary to build and run the actual tests. - // FIXME(jieyouxu): use `std::env::consts::EXE_EXTENSION`. - let recipe_bin = base_dir.join(if self.config.target.contains("windows") { - "rmake.exe" - } else { - "rmake" - }); + // Calculate the paths of the recipe binary. As previously discussed, this is placed at + // `<base_dir>/<bin_name>` with `bin_name` being `rmake` or `rmake.exe` dependending on + // platform. + let recipe_bin = { + let mut p = base_dir.join("rmake"); + p.set_extension(env::consts::EXE_EXTENSION); + p + }; debug!(?recipe_bin); // FIXME(jieyouxu): explain what the hecc we are doing here. |
