(
#[case] name: &str,
#[case] features: &[&str],
)
| 12 | #[case("mimalloc", &["with-mimalloc"])] |
| 13 | #[test_log::test] |
| 14 | fn test_rust_alloc_tracking( |
| 15 | #[case] name: &str, |
| 16 | #[case] features: &[&str], |
| 17 | ) -> Result<(), Box<dyn std::error::Error>> { |
| 18 | let crate_path = Path::new("testdata/alloc_rust"); |
| 19 | let binary = shared::compile_rust_binary(crate_path, "alloc_rust", features)?; |
| 20 | |
| 21 | // Try to find a static allocator in the binary, then attach to it as well |
| 22 | // This is needed because the CWD is different, which breaks the heuristics. |
| 23 | let allocators = AllocatorLib::from_path_static(&binary) |
| 24 | .map(|a| vec![a]) |
| 25 | .unwrap_or_default(); |
| 26 | |
| 27 | let (events, thread_handle) = shared::track_binary_with_opts(&binary, &allocators)?; |
| 28 | assert_events_with_marker!(name, &events); |
| 29 | |
| 30 | thread_handle.join().unwrap(); |
| 31 | Ok(()) |
| 32 | } |
nothing calls this directly
no test coverage detected