From d5b763e93f63fffb3021ef3a02af8fc2ac1d0016 Mon Sep 17 00:00:00 2001 From: Daniel Lehmann Date: Sat, 27 Jul 2024 15:20:56 +0200 Subject: [PATCH] print file information as well on wasm-validate warnings --- crates/test_utilities/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/test_utilities/src/lib.rs b/crates/test_utilities/src/lib.rs index a6f46477..69a445d8 100644 --- a/crates/test_utilities/src/lib.rs +++ b/crates/test_utilities/src/lib.rs @@ -164,8 +164,10 @@ pub fn wasm_validate(path: impl AsRef) -> Result<(), WasmValidateError> { assert!(validate_output.stdout.is_empty()); // Warnings don't make validation fail but _are_ printed on stderr. let stderr = String::from_utf8_lossy(&validate_output.stderr); + let stderr = stderr.trim(); if !stderr.is_empty() { - eprintln!("wasm-validate warning: {stderr}"); + let file_info = WasmFileInfo::new(path); + eprintln!("wasm-validate warning on {file_info}: {stderr}"); } Ok(()) },