Fix running simple-raytracer benchmark on Windows

This commit is contained in:
bjorn3 2022-12-15 14:16:39 +00:00
parent 6c88b08adc
commit 1ca07b9a44
2 changed files with 12 additions and 9 deletions

View File

@ -186,10 +186,6 @@ jobs:
run: |
# WIP Disable some tests
# This fails due to some weird argument handling by hyperfine, not an actual regression
# more of a build system issue
(Get-Content config.txt) -replace '(bench.simple-raytracer)', '# $1' | Out-File config.txt
# This fails with a different output than expected
(Get-Content config.txt) -replace '(test.regex-shootout-regex-dna)', '# $1' | Out-File config.txt

View File

@ -2,7 +2,7 @@
use super::config;
use super::path::{Dirs, RelPath};
use super::prepare::GitRepo;
use super::rustc_info::get_wrapper_file_name;
use super::rustc_info::{get_file_name, get_wrapper_file_name};
use super::utils::{
hyperfine_command, is_ci, spawn_and_wait, spawn_and_wait_with_input, CargoProject, Compiler,
};
@ -318,13 +318,20 @@ const fn new(config: &'static str, func: &'static dyn Fn(&TestRunner)) -> Self {
eprintln!("[BENCH RUN] ebobby/simple-raytracer");
fs::copy(
target_dir.join("debug").join("main"),
RelPath::BUILD.to_path(&runner.dirs).join("raytracer_cg_clif"),
target_dir.join("debug").join(get_file_name("main", "bin")),
RelPath::BUILD
.to_path(&runner.dirs)
.join(get_file_name("raytracer_cg_clif", "bin")),
)
.unwrap();
let mut bench_run =
hyperfine_command(0, run_runs, None, "./raytracer_cg_llvm", "./raytracer_cg_clif");
let mut bench_run = hyperfine_command(
0,
run_runs,
None,
Path::new(".").join(get_file_name("raytracer_cg_llvm", "bin")).to_str().unwrap(),
Path::new(".").join(get_file_name("raytracer_cg_clif", "bin")).to_str().unwrap(),
);
bench_run.current_dir(RelPath::BUILD.to_path(&runner.dirs));
spawn_and_wait(bench_run);
} else {