tests: Readd suffix to actual/difference files
This commit is contained in:
parent
67ec70d960
commit
9c4190b20b
|
@ -94,8 +94,8 @@ jobs:
|
|||
with:
|
||||
name: swf_images
|
||||
path: |
|
||||
tests*/**/actual.png
|
||||
tests*/**/difference.png
|
||||
tests*/**/actual*.png
|
||||
tests*/**/difference*.png
|
||||
|
||||
check-required:
|
||||
needs: changes
|
||||
|
|
|
@ -160,6 +160,7 @@ impl ImageComparison {
|
|||
actual_image: image::RgbaImage,
|
||||
expected_image: image::RgbaImage,
|
||||
test_path: &Path,
|
||||
adapter_info: ruffle_render_wgpu::wgpu::AdapterInfo,
|
||||
) -> Result<()> {
|
||||
use anyhow::Context;
|
||||
|
||||
|
@ -196,16 +197,18 @@ impl ImageComparison {
|
|||
.unwrap();
|
||||
|
||||
if outliers > self.max_outliers {
|
||||
let suffix = format!("{}-{:?}", std::env::consts::OS, adapter_info.backend);
|
||||
|
||||
image::RgbaImage::from_raw(
|
||||
expected_image.width(),
|
||||
expected_image.height(),
|
||||
difference_data,
|
||||
)
|
||||
.context("Couldn't create difference image")?
|
||||
.save(test_path.join("difference.png"))
|
||||
.save(test_path.join(format!("difference-{suffix}.png")))
|
||||
.context("Couldn't save difference image")?;
|
||||
actual_image
|
||||
.save(test_path.join("actual.png"))
|
||||
.save(test_path.join(format!("actual-{suffix}.png")))
|
||||
.context("Couldn't save actual image")?;
|
||||
|
||||
return Err(anyhow!(
|
||||
|
|
|
@ -147,7 +147,12 @@ pub fn run_swf(
|
|||
.context("Failed to open expected image")?
|
||||
.into_rgba8();
|
||||
|
||||
image_comparison.test(actual_image, expected_image, base_path)?;
|
||||
image_comparison.test(
|
||||
actual_image,
|
||||
expected_image,
|
||||
base_path,
|
||||
renderer.descriptors().adapter.get_info(),
|
||||
)?;
|
||||
} else {
|
||||
actual_image.save(expected_image_path)?;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue