add frontend tests

This commit is contained in:
takotori 2024-06-01 14:25:02 +02:00
parent fe85ff3c70
commit 1e4ca9f73a
3 changed files with 23 additions and 2 deletions

View file

@ -11,6 +11,7 @@ use gtk::{gio, Application, CssProvider};
use reset_daemon::run_daemon;
mod components;
mod tests;
const APP_ID: &str = "org.Xetibo.ReSet";

19
src/tests.rs Normal file
View file

@ -0,0 +1,19 @@
use std::thread;
use std::time::Duration;
use re_set_lib::utils::plugin_setup::FRONTEND_PLUGINS;
use crate::daemon_check;
#[tokio::test]
#[cfg(test)]
async fn test_plugins() {
use re_set_lib::utils::plugin::plugin_tests;
tokio::task::spawn(daemon_check());
thread::sleep(Duration::from_millis(2000));
unsafe {
for plugin in FRONTEND_PLUGINS.iter() {
let name = (plugin.frontend_name)();
let tests = (plugin.frontend_tests)();
plugin_tests(name, tests);
}
}
}