Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit c69a965

Browse files
authored
Make test run on Windows
1 parent a11f5e8 commit c69a965

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/agent/coverage/examples/coverage.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,21 @@ mod test {
174174

175175
#[test]
176176
fn can_run_coverage() {
177-
let cmd = command(&["ls".to_string()], None);
177+
#[cfg(target_os = "linux")]
178+
let cmd = command(&["ls"].map(str::to_string), None);
179+
180+
#[cfg(target_os = "windows")]
181+
let cmd = command(&["cmd.exe", "/c", "dir"].map(str::to_string), None);
182+
178183
let recorded = CoverageRecorder::new(cmd)
179184
.timeout(Duration::from_secs(5))
180185
.record()
181186
.unwrap();
182187

188+
assert_ne!("", recorded.output.stdout);
189+
190+
// only non-debuggable modules are found on Windows
191+
#[cfg(target_os = "linux")]
183192
assert!(recorded.coverage.modules.len() > 0);
184193
}
185194
}

0 commit comments

Comments
 (0)