Skip to content

Commit f138ab8

Browse files
committed
compiletest/rmake: cleanup rmake exe extension calculation
1 parent f76a86d commit f138ab8

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3476,7 +3476,7 @@ impl<'test> TestCx<'test> {
34763476

34773477
// We construct the following directory tree for each rmake.rs test:
34783478
// ```
3479-
// base_dir/
3479+
// <base_dir>/
34803480
// rmake.exe
34813481
// rmake_out/
34823482
// ```
@@ -3594,13 +3594,14 @@ impl<'test> TestCx<'test> {
35943594
paths
35953595
};
35963596

3597-
// Finally, we need to run the recipe binary to build and run the actual tests.
3598-
// FIXME(jieyouxu): use `std::env::consts::EXE_EXTENSION`.
3599-
let recipe_bin = base_dir.join(if self.config.target.contains("windows") {
3600-
"rmake.exe"
3601-
} else {
3602-
"rmake"
3603-
});
3597+
// Calculate the paths of the recipe binary. As previously discussed, this is placed at
3598+
// `<base_dir>/<bin_name>` with `bin_name` being `rmake` or `rmake.exe` dependending on
3599+
// platform.
3600+
let recipe_bin = {
3601+
let mut p = base_dir.join("rmake");
3602+
p.set_extension(env::consts::EXE_EXTENSION);
3603+
p
3604+
};
36043605
debug!(?recipe_bin);
36053606

36063607
// FIXME(jieyouxu): explain what the hecc we are doing here.

0 commit comments

Comments
 (0)