tests: If an image test isn't being checked and we expect it to fail, make it fail
This commit is contained in:
parent
049cb0e84d
commit
1ffb87c227
|
@ -239,13 +239,18 @@ pub fn run_swf(
|
||||||
|
|
||||||
// Render the image to disk
|
// Render the image to disk
|
||||||
// FIXME: Determine how we want to compare against on on-disk image
|
// FIXME: Determine how we want to compare against on on-disk image
|
||||||
#[cfg(feature = "imgtests")]
|
#[allow(unused_variables)]
|
||||||
if let Some(image_comparison) = &test.options.image_comparison {
|
if let Some(image_comparison) = &test.options.image_comparison {
|
||||||
|
#[allow(unused_mut)]
|
||||||
|
let mut checked_image = false;
|
||||||
|
|
||||||
|
#[cfg(feature = "imgtests")]
|
||||||
if crate::util::environment::wgpu_descriptors().is_some() {
|
if crate::util::environment::wgpu_descriptors().is_some() {
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use ruffle_render_wgpu::backend::WgpuRenderBackend;
|
use ruffle_render_wgpu::backend::WgpuRenderBackend;
|
||||||
use ruffle_render_wgpu::target::TextureTarget;
|
use ruffle_render_wgpu::target::TextureTarget;
|
||||||
|
|
||||||
|
checked_image = true;
|
||||||
let mut player_lock = player.lock().unwrap();
|
let mut player_lock = player.lock().unwrap();
|
||||||
player_lock.render();
|
player_lock.render();
|
||||||
let renderer = player_lock
|
let renderer = player_lock
|
||||||
|
@ -273,6 +278,14 @@ pub fn run_swf(
|
||||||
actual_image.save(expected_image_path)?;
|
actual_image.save(expected_image_path)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if test.options.known_failure && !checked_image {
|
||||||
|
// It's possible that the trace output matched but the image might not.
|
||||||
|
// If we aren't checking the image, pretend the match failed (which makes it actually pass, since it's expecting failure).
|
||||||
|
return Err(anyhow!(
|
||||||
|
"Not checking images, pretending this failed since we don't know if it worked."
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
before_end(player)?;
|
before_end(player)?;
|
||||||
|
|
Loading…
Reference in New Issue