Skip to content

Commit edabf0a

Browse files
xtask: Avoid huge pixel dump on screenshot failure
Use `assert!` rather than `assert_eq!` so that if the screenshot comparison fails, we don't dump all the raw pixel data to the console.
1 parent c8ff89a commit edabf0a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

xtask/src/qemu.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,12 @@ fn process_qemu_io(mut monitor_io: Io, mut serial_io: Io, tmp_dir: &Path) -> Res
337337
Path::new("uefi-test-runner/screenshots").join(format!("{reference_name}.ppm"));
338338
let expected = fs_err::read(reference_file)?;
339339
let actual = fs_err::read(&screenshot_path)?;
340-
assert_eq!(expected, actual);
340+
// Use `assert` rather than `assert_eq` here to avoid
341+
// dumping a huge amount of raw pixel data on failure.
342+
assert!(
343+
expected == actual,
344+
"screenshot does not match reference image"
345+
)
341346
}
342347
}
343348

0 commit comments

Comments
 (0)