Skip to content

Commit

Permalink
feat: Add name for plugin in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DashieTM committed Mar 22, 2024
1 parent 8e6389d commit 0a43920
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,5 @@ fn test_custom_tests() {
let func1 = PluginTestFunc::new(func1, "henlo");
let func2 = PluginTestFunc::new(func2, "fail");
let funcs = vec![func1, func2];
plugin_tests(funcs);
plugin_tests("libtest",funcs);
}
7 changes: 5 additions & 2 deletions src/utils/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl FnOnce<()> for PluginTestFunc {
unsafe impl Send for PluginTestFunc {}
unsafe impl Sync for PluginTestFunc {}

pub fn plugin_tests(tests: Vec<PluginTestFunc>) {
pub fn plugin_tests(plugig_name: &'static str, tests: Vec<PluginTestFunc>) {
use std::thread;

let mut running = String::from("");
Expand Down Expand Up @@ -144,7 +144,10 @@ pub fn plugin_tests(tests: Vec<PluginTestFunc>) {
}
}
let mut buffer = String::from("");
buffer += "\n----------- Plugin Tests -----------\n\n";
buffer += &format!(
"\n----------- Plugin Tests for {} -----------\n\n",
plugig_name
);
buffer += &format!("running {} tests:\n", running_index);
buffer += &running;
buffer += &format!("\n{} test crashed:\n", crashed_index);
Expand Down

0 comments on commit 0a43920

Please sign in to comment.