From eb72cfb4987ab48b08d56974cf566f5371fa9ee5 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Thu, 9 Nov 2023 17:50:33 +0100 Subject: [PATCH] tests: Removed the need for test framework to depend on libtest_mimic --- Cargo.lock | 1 - tests/framework/Cargo.toml | 1 - tests/framework/src/test.rs | 6 +++--- tests/tests/external_interface/tests.rs | 8 ++++---- tests/tests/regression_tests.rs | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c240a5b51cd2..8a13b4bb49af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4265,7 +4265,6 @@ dependencies = [ "env_logger", "futures", "image", - "libtest-mimic", "pretty_assertions", "regex", "ruffle_core", diff --git a/tests/framework/Cargo.toml b/tests/framework/Cargo.toml index 01cbe1cf9c29..0bb1024bc168 100644 --- a/tests/framework/Cargo.toml +++ b/tests/framework/Cargo.toml @@ -25,7 +25,6 @@ tracing = { workspace = true} tracing-subscriber = { workspace = true } serde = "1.0.190" toml = "0.8.6" -libtest-mimic = "0.6.1" anyhow = "1.0.75" async-channel = "1.9.0" diff --git a/tests/framework/src/test.rs b/tests/framework/src/test.rs index d955c6a4c8e4..4c9ac9b9adfa 100644 --- a/tests/framework/src/test.rs +++ b/tests/framework/src/test.rs @@ -52,7 +52,7 @@ impl Test { mut before_start: impl FnMut(Arc>) -> Result<()>, mut before_end: impl FnMut(Arc>) -> Result<()>, environment: &impl Environment, - ) -> std::result::Result<(), libtest_mimic::Failed> { + ) -> Result<()> { set_logger(); let movie = SwfMovie::from_path(&self.swf_path, None).map_err(|e| anyhow!(e.to_string()))?; @@ -93,7 +93,7 @@ impl Test { Ok(()) } - fn socket_events(&self) -> Result>, libtest_mimic::Failed> { + fn socket_events(&self) -> Result>> { Ok(if self.socket_path.is_file() { Some(SocketEvent::from_file(&self.socket_path)?) } else { @@ -101,7 +101,7 @@ impl Test { }) } - fn input_injector(&self) -> Result { + fn input_injector(&self) -> Result { Ok(if self.input_path.is_file() { InputInjector::from_file(&self.input_path)? } else { diff --git a/tests/tests/external_interface/tests.rs b/tests/tests/external_interface/tests.rs index ac430e21026b..89049a3e221a 100644 --- a/tests/tests/external_interface/tests.rs +++ b/tests/tests/external_interface/tests.rs @@ -11,7 +11,7 @@ pub fn external_interface_avm1( environment: &impl Environment, ) -> Result<(), libtest_mimic::Failed> { set_logger(); - Test::from_options( + Ok(Test::from_options( TestOptions { num_frames: Some(1), ..Default::default() @@ -63,14 +63,14 @@ pub fn external_interface_avm1( Ok(()) }, environment, - ) + )?) } pub fn external_interface_avm2( environment: &impl Environment, ) -> Result<(), libtest_mimic::Failed> { set_logger(); - Test::from_options( + Ok(Test::from_options( TestOptions { num_frames: Some(1), ..Default::default() @@ -113,5 +113,5 @@ pub fn external_interface_avm2( Ok(()) }, environment, - ) + )?) } diff --git a/tests/tests/regression_tests.rs b/tests/tests/regression_tests.rs index ebbd29a35ad4..69b1b38e4e34 100644 --- a/tests/tests/regression_tests.rs +++ b/tests/tests/regression_tests.rs @@ -69,7 +69,7 @@ fn main() { } } else { match unwind_result { - Ok(r) => r, + Ok(r) => Ok(r?), Err(e) => resume_unwind(e), } }