Skip to content

Commit ff0bf7f

Browse files
committed
compiletest/rmake: cleanup rmake exe extension calculation
1 parent cfad341 commit ff0bf7f

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
@@ -3481,7 +3481,7 @@ impl<'test> TestCx<'test> {
34813481

34823482
// We construct the following directory tree for each rmake.rs test:
34833483
// ```
3484-
// base_dir/
3484+
// <base_dir>/
34853485
// rmake.exe
34863486
// rmake_out/
34873487
// ```
@@ -3599,13 +3599,14 @@ impl<'test> TestCx<'test> {
35993599
paths
36003600
};
36013601

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

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

0 commit comments

Comments
 (0)