This commit is contained in:
Anton-4 2023-12-26 13:26:31 +01:00
parent 9e6ca69843
commit 0987be4c2d
No known key found for this signature in database
GPG key ID: 0971D718C0A9B937
3 changed files with 11 additions and 6 deletions

View file

@ -1,8 +1,7 @@
# Running the benchmarks # Running the benchmarks
Install cargo criterion: If you're not using nix, install cargo criterion:
```sh ```sh
cargo install cargo-criterion cargo install cargo-criterion
``` ```
@ -13,7 +12,7 @@ To prevent stack overflow on the `CFold` benchmark:
ulimit -s unlimited ulimit -s unlimited
``` ```
In the `cli` folder execute: In the `crates/cli` folder execute:
```sh ```sh
cargo criterion cargo criterion

View file

@ -20,7 +20,7 @@ fn exec_bench_w_input<T: Measurement>(
); );
if !compile_out.stderr.is_empty() && compile_out.stderr != "🔨 Rebuilding platform...\n" { if !compile_out.stderr.is_empty() && compile_out.stderr != "🔨 Rebuilding platform...\n" {
panic!("{}", compile_out.stderr); panic!("stderr was not empty:\n\t{}", compile_out.stderr);
} }
assert!( assert!(

View file

@ -250,12 +250,18 @@ pub fn run_cmd<'a, I: IntoIterator<Item = &'a str>, E: IntoIterator<Item = (&'a
let cmd_str = pretty_command_string(&cmd); let cmd_str = pretty_command_string(&cmd);
dbg!(cmd
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.spawn());
let mut child = cmd let mut child = cmd
.stdin(Stdio::piped()) .stdin(Stdio::piped())
.stdout(Stdio::piped()) .stdout(Stdio::piped())
.stderr(Stdio::piped()) .stderr(Stdio::piped())
.spawn() .spawn()
.unwrap_or_else(|_| panic!("failed to execute cmd `{cmd_name}` in CLI test")); .unwrap_or_else(|_| panic!("Failed to execute cmd:\n\t`{:?}`", cmd_str));
{ {
let stdin = child.stdin.as_mut().expect("Failed to open stdin"); let stdin = child.stdin.as_mut().expect("Failed to open stdin");
@ -269,7 +275,7 @@ pub fn run_cmd<'a, I: IntoIterator<Item = &'a str>, E: IntoIterator<Item = (&'a
let output = child let output = child
.wait_with_output() .wait_with_output()
.unwrap_or_else(|_| panic!("failed to execute cmd `{cmd_name}` in CLI test")); .unwrap_or_else(|_| panic!("Failed to execute cmd:\n\t`{:?}`", cmd_str));
Out { Out {
cmd_str, cmd_str,