From 08e4e2575f803920125b556fb1f4efa38e72bf19 Mon Sep 17 00:00:00 2001 From: Johnnie Birch Date: Thu, 15 Aug 2024 18:31:14 -0700 Subject: [PATCH 1/4] Add search for a default expected file and include for libsodium --- benchmarks/libsodium/default.stderr.expected | 0 benchmarks/libsodium/default.stdout.expected | 1 + crates/cli/src/benchmark.rs | 10 ++++++++-- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 benchmarks/libsodium/default.stderr.expected create mode 100644 benchmarks/libsodium/default.stdout.expected diff --git a/benchmarks/libsodium/default.stderr.expected b/benchmarks/libsodium/default.stderr.expected new file mode 100644 index 00000000..e69de29b diff --git a/benchmarks/libsodium/default.stdout.expected b/benchmarks/libsodium/default.stdout.expected new file mode 100644 index 00000000..c2270834 --- /dev/null +++ b/benchmarks/libsodium/default.stdout.expected @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/crates/cli/src/benchmark.rs b/crates/cli/src/benchmark.rs index ae496ac4..fd23a9a1 100644 --- a/crates/cli/src/benchmark.rs +++ b/crates/cli/src/benchmark.rs @@ -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)?; From a4c14df626eb84270f1e5199bff4a97b1dc8a581 Mon Sep 17 00:00:00 2001 From: Johnnie Birch Date: Fri, 23 Aug 2024 20:50:07 -0700 Subject: [PATCH 2/4] Add expected files for libsodium with non-default output. --- benchmarks/libsodium/libsodium-sodium_utils2.stderr.expected | 0 benchmarks/libsodium/libsodium-sodium_utils2.stdout.expected | 0 benchmarks/libsodium/libsodium-sodium_utils3.stderr.expected | 0 benchmarks/libsodium/libsodium-sodium_utils3.stdout.expected | 0 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 benchmarks/libsodium/libsodium-sodium_utils2.stderr.expected create mode 100644 benchmarks/libsodium/libsodium-sodium_utils2.stdout.expected create mode 100644 benchmarks/libsodium/libsodium-sodium_utils3.stderr.expected create mode 100644 benchmarks/libsodium/libsodium-sodium_utils3.stdout.expected diff --git a/benchmarks/libsodium/libsodium-sodium_utils2.stderr.expected b/benchmarks/libsodium/libsodium-sodium_utils2.stderr.expected new file mode 100644 index 00000000..e69de29b diff --git a/benchmarks/libsodium/libsodium-sodium_utils2.stdout.expected b/benchmarks/libsodium/libsodium-sodium_utils2.stdout.expected new file mode 100644 index 00000000..e69de29b diff --git a/benchmarks/libsodium/libsodium-sodium_utils3.stderr.expected b/benchmarks/libsodium/libsodium-sodium_utils3.stderr.expected new file mode 100644 index 00000000..e69de29b diff --git a/benchmarks/libsodium/libsodium-sodium_utils3.stdout.expected b/benchmarks/libsodium/libsodium-sodium_utils3.stdout.expected new file mode 100644 index 00000000..e69de29b From 0727eaaedd7ca59522b3dc0e75938ddcb3a7b052 Mon Sep 17 00:00:00 2001 From: Johnnie Birch Date: Tue, 27 Aug 2024 16:35:27 -0700 Subject: [PATCH 3/4] Update crates/cli/src/benchmark.rs Co-authored-by: Andrew Brown --- crates/cli/src/benchmark.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cli/src/benchmark.rs b/crates/cli/src/benchmark.rs index fd23a9a1..73341b3f 100644 --- a/crates/cli/src/benchmark.rs +++ b/crates/cli/src/benchmark.rs @@ -246,7 +246,7 @@ impl BenchmarkCommand { .with_context(|| "expected the benchmark file to have a printable 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")); + stdout_expected = wasm_file_dir.join("default.stdout.expected"); } let mut stderr_expected = wasm_file_dir.join(format!("{}.stderr.expected", benchmark_name)); if !stderr_expected.exists() { From 22fc2dd320b7ed453c8dcaae4f30552b4f151120 Mon Sep 17 00:00:00 2001 From: Johnnie Birch Date: Tue, 27 Aug 2024 16:35:41 -0700 Subject: [PATCH 4/4] Update crates/cli/src/benchmark.rs Co-authored-by: Andrew Brown --- crates/cli/src/benchmark.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cli/src/benchmark.rs b/crates/cli/src/benchmark.rs index 73341b3f..a800adb9 100644 --- a/crates/cli/src/benchmark.rs +++ b/crates/cli/src/benchmark.rs @@ -250,7 +250,7 @@ impl BenchmarkCommand { } 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")); + stderr_expected = wasm_file_dir.join("default.stderr.expected"); } compare_output_file(wasm_file, stdout, &stdout_expected)?;