sofie_testing/display_zone.rs
1use sofie_core::DisplayZone;
2
3/// Called first by every test in the binary: reading an instant fixes the zone for the whole
4/// binary, as for the app's process.
5pub fn set_display_zone(name: &str) {
6 let zone = DisplayZone::named(name).unwrap_or_else(|error| panic!("{error}"));
7 if let Err(error) = zone.install() {
8 panic!(
9 "{error}: a test binary has one display zone, so a test in another zone goes in its own file under tests/"
10 );
11 }
12}