diff --git a/.github/workflows/test_rust.yml b/.github/workflows/test_rust.yml index a86db2697..82c5b591b 100644 --- a/.github/workflows/test_rust.yml +++ b/.github/workflows/test_rust.yml @@ -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 diff --git a/tests/tests/util/options.rs b/tests/tests/util/options.rs index b79b61368..88673de16 100644 --- a/tests/tests/util/options.rs +++ b/tests/tests/util/options.rs @@ -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!( diff --git a/tests/tests/util/runner.rs b/tests/tests/util/runner.rs index 99d3bcfd1..872c3f282 100644 --- a/tests/tests/util/runner.rs +++ b/tests/tests/util/runner.rs @@ -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)?; }