(#[case] target: &str)
| 54 | #[case("alloc_cpp_tcmalloc_dynamic")] |
| 55 | #[test_log::test] |
| 56 | fn test_cpp_alloc_tracking(#[case] target: &str) -> Result<(), Box<dyn std::error::Error>> { |
| 57 | let project_path = Path::new("testdata/alloc_cpp"); |
| 58 | let binary = compile_cpp_project(project_path, target)?; |
| 59 | |
| 60 | // Try to find a static allocator in the binary, then attach to it as well |
| 61 | // This is needed because the CWD is different, which breaks the heuristics. |
| 62 | let allocators = AllocatorLib::from_path_static(&binary) |
| 63 | .map(|a| vec![a]) |
| 64 | .unwrap_or_default(); |
| 65 | |
| 66 | let (events, thread_handle) = shared::track_binary_with_opts(&binary, &allocators)?; |
| 67 | assert_events_with_marker!(target, &events); |
| 68 | |
| 69 | thread_handle.join().unwrap(); |
| 70 | Ok(()) |
| 71 | } |
nothing calls this directly
no test coverage detected