Skip to content

Commit

Permalink
Add search for a default expected file and include for libsodium
Browse files Browse the repository at this point in the history
  • Loading branch information
jlb6740 committed Aug 16, 2024
1 parent fa44334 commit 08e4e25
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Empty file.
1 change: 1 addition & 0 deletions benchmarks/libsodium/default.stdout.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
10 changes: 8 additions & 2 deletions crates/cli/src/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,14 @@ impl BenchmarkCommand {
.with_context(|| "expected the benchmark file to have an extension")?
.to_str()
.with_context(|| "expected the benchmark file to have a printable name")?;
let stdout_expected = wasm_file_dir.join(format!("{}.stdout.expected", benchmark_name));
let stderr_expected = wasm_file_dir.join(format!("{}.stderr.expected", benchmark_name));
let mut stdout_expected = wasm_file_dir.join(format!("{}.stdout.expected", benchmark_name));
if !stdout_expected.exists() {
stdout_expected = wasm_file_dir.join(format!("{}.stdout.expected", "default"));
}
let mut stderr_expected = wasm_file_dir.join(format!("{}.stderr.expected", benchmark_name));
if !stderr_expected.exists() {
stderr_expected = wasm_file_dir.join(format!("{}.stderr.expected", "default"));
}

compare_output_file(wasm_file, stdout, &stdout_expected)?;
compare_output_file(wasm_file, stderr, &stderr_expected)?;
Expand Down

0 comments on commit 08e4e25

Please sign in to comment.