Skip to content

Commit

Permalink
handle wasm-validate warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
danleh committed Jul 27, 2024
1 parent 3777a39 commit 1841fd5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/test_utilities/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ pub fn wasm_validate(path: impl AsRef<Path>) -> Result<(), WasmValidateError> {
Ok(validate_output) => match validate_output.status.code() {
Some(0) => {
assert!(validate_output.stdout.is_empty());
assert!(validate_output.stderr.is_empty(), "{}", String::from_utf8_lossy(&validate_output.stderr));
// Warnings don't make validation fail but _are_ printed on stderr.
let stderr = String::from_utf8_lossy(&validate_output.stderr);
if !stderr.is_empty() {
eprintln!("wasm-validate warning: {stderr}");
}
Ok(())
},
Some(status_code) => Err(WasmValidateError::InvalidWasmFile {
Expand Down

0 comments on commit 1841fd5

Please sign in to comment.