Skip to content

Commit c7eb6a7

Browse files
committed
tests/executable.rs: skip the watch test when using kcov
As documented in a new comment, this test won't work when trying to use kcov. That's fine.
1 parent a7d74d2 commit c7eb6a7

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tests/executable.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,26 @@ fn run_tectonic(cwd: &Path, args: &[&str]) -> Output {
120120
}
121121

122122
fn run_tectonic_until(cwd: &Path, args: &[&str], mut kill: impl FnMut() -> bool) -> Output {
123+
// This harness doesn't work when running with kcov because there's no good
124+
// way to stop the Tectonic child process that is "inside" of the kcov
125+
// runner. If we kill kcov itself, the child process keeps running and we
126+
// hang because our pipes never get fully closed. Right now I don't see a
127+
// way to actually terminate the Tectonic subprocess short of guessing its
128+
// PID, which is hackier than I want to implement. We could address this by
129+
// providing some other mechanism to tell the "watch" subprocess to stop,
130+
// such as closing its stdin.
131+
assert_eq!(KCOV_WORDS.len(), 0, "\"until\" tests do not work with kcov");
132+
123133
let mut command = prep_tectonic(cwd, args);
124134
command.stdout(Stdio::piped()).stderr(Stdio::piped());
125135
command.env("BROWSER", "echo");
136+
126137
println!("running {command:?} until test passes");
127138
let mut child = command.spawn().expect("tectonic failed to start");
128139
while !kill() {
129140
thread::sleep(Duration::from_secs(1));
130141
}
142+
131143
// Ignore if the child already died
132144
let _ = child.kill();
133145
child
@@ -934,6 +946,10 @@ fn bad_v2_position_build() {
934946
#[cfg(all(feature = "serialization", not(target_arch = "mips")))]
935947
#[test]
936948
fn v2_watch_succeeds() {
949+
if KCOV_WORDS.len() > 0 {
950+
return; // See run_tectonic_until() for an explanation of why this test must be skipped
951+
}
952+
937953
let (_tempdir, temppath) = setup_v2();
938954

939955
// Timeout the test after 5 minutes - we should definitely run twice in that range

0 commit comments

Comments
 (0)