(
test_case: &AllocationTestCase,
stack_capture: bool,
snapshot_name: &str,
)
| 89 | ]; |
| 90 | |
| 91 | fn assert_stack_snapshot( |
| 92 | test_case: &AllocationTestCase, |
| 93 | stack_capture: bool, |
| 94 | snapshot_name: &str, |
| 95 | ) -> Result<(), Box<dyn std::error::Error>> { |
| 96 | let temp_dir = TempDir::new()?; |
| 97 | let binary = shared::compile_c_source(test_case.source, test_case.name, temp_dir.path())?; |
| 98 | let options = TrackerOptions::builder() |
| 99 | .stack_capture(stack_capture) |
| 100 | .build(); |
| 101 | let (events, thread_handle) = shared::track_command(Command::new(binary), options)?; |
| 102 | |
| 103 | insta::assert_debug_snapshot!(snapshot_name, format_events(&events)); |
| 104 | |
| 105 | thread_handle |
| 106 | .join() |
| 107 | .expect("tracker teardown thread panicked"); |
| 108 | Ok(()) |
| 109 | } |
| 110 | |
| 111 | #[test_with::env(GITHUB_ACTIONS)] |
| 112 | #[rstest] |
no test coverage detected