mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-27 01:08:33 +00:00
Serialise the viewer frame tests that read the process-wide LUT generation
This commit is contained in:
@@ -256,10 +256,15 @@ impl EffectcraftApp {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
/// The LUT generation is process-wide: a test that changes a LUT file moves it for every
|
||||
/// viewer in the process, so the tests that read frame keys run one at a time.
|
||||
static LUT_GENERATION: std::sync::Mutex<()> = std::sync::Mutex::new(());
|
||||
|
||||
/// #3493: the viewer shows the frame again once the LUT file it was graded with changes,
|
||||
/// though its key was otherwise the same (same project revision, frame and options).
|
||||
#[test]
|
||||
fn the_viewer_shows_a_lut_file_changed_on_disk() {
|
||||
let _serial = LUT_GENERATION.lock().unwrap_or_else(std::sync::PoisonError::into_inner);
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let lut = dir.path().join("viewer.cube");
|
||||
let write = |text: &str, secs: u64| {
|
||||
@@ -302,6 +307,7 @@ mod tests {
|
||||
/// frame having the key of the one on screen. A reload's purge gives the frames new keys, once.
|
||||
#[test]
|
||||
fn the_viewers_show_a_still_reloaded_at_the_same_size() {
|
||||
let _serial = LUT_GENERATION.lock().unwrap_or_else(std::sync::PoisonError::into_inner);
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let png = dir.path().join("still.png");
|
||||
let save = |rgb: [u8; 3]| image::RgbaImage::from_pixel(64, 36, image::Rgba([rgb[0], rgb[1], rgb[2], 255])).save(&png).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user