diff options
| author | Mason Reed <mason@vector35.com> | 2025-02-26 20:56:18 -0500 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-02-26 21:05:34 -0500 |
| commit | dc8015f6695ee069279dfbd681000e8b1fcd30e5 (patch) | |
| tree | c1e387c68a249ff90999bbdcc4fa90372516d88c /rust/tests/project.rs | |
| parent | 4608523101738492124069765324141966372229 (diff) | |
Remove module level `Session` initialization in Rust unit tests
This was preventing the enterprise license checkout from dropping, also the initialization story is much better than it was when we added the rstest fixtures, we can get away with initialization in parallel more broadly.
Diffstat (limited to 'rust/tests/project.rs')
| -rw-r--r-- | rust/tests/project.rs | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/rust/tests/project.rs b/rust/tests/project.rs index cc41c11e..f7d49bad 100644 --- a/rust/tests/project.rs +++ b/rust/tests/project.rs @@ -2,23 +2,17 @@ use binaryninja::headless::Session; use binaryninja::metadata::Metadata; use binaryninja::project::Project; use binaryninja::rc::Ref; -use rstest::*; use std::time::SystemTime; // TODO: We should use tempdir to manage the project directory. -#[fixture] -#[once] -fn session() -> Session { - Session::new().expect("Failed to initialize session") -} - fn unique_project(name: &str) -> String { format!("{}/{}", std::env::temp_dir().to_str().unwrap(), name) } -#[rstest] -fn create_delete_empty(_session: &Session) { +#[test] +fn create_delete_empty() { + let _session = Session::new().expect("Failed to initialize session"); use std::fs::canonicalize; let project_name = "create_delete_empty_project"; @@ -46,8 +40,9 @@ fn create_delete_empty(_session: &Session) { std::fs::remove_dir_all(project_path).unwrap(); } -#[rstest] -fn create_close_open_close(_session: &Session) { +#[test] +fn create_close_open_close() { + let _session = Session::new().expect("Failed to initialize session"); let project_name = "create_close_open_close"; let project_path = unique_project(project_name); // create the project @@ -74,8 +69,9 @@ fn create_close_open_close(_session: &Session) { std::fs::remove_dir_all(project_path).unwrap(); } -#[rstest] -fn modify_project(_session: &Session) { +#[test] +fn modify_project() { + let _session = Session::new().expect("Failed to initialize session"); let project_name = "modify_project_project"; let project_path = unique_project(project_name); // create the project |
