Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debugging "fail now" on windows #261

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions testscript/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ func (ts *TestScript) waitBackgroundOne(bgName string) {
}
// Note: ignore bg.neg, which only takes effect on the non-specific
// wait command.
println(ts.file, bg.cmd.ProcessState.Success(), bg.cmd.ProcessState.Exited(), bg.cmd.ProcessState.ExitCode())
if bg.cmd.ProcessState.Success() {
if bg.neg {
ts.Fatalf("unexpected command success")
Expand Down Expand Up @@ -634,6 +635,7 @@ func (ts *TestScript) waitBackground(checkStatus bool) {
if !checkStatus {
continue
}
println(ts.file, bg.cmd.ProcessState.Success(), bg.cmd.ProcessState.Exited(), bg.cmd.ProcessState.ExitCode())
if bg.cmd.ProcessState.Success() {
if bg.neg {
ts.Fatalf("unexpected command success")
Expand Down
4 changes: 4 additions & 0 deletions testscript/testdata/interrupt_implicit.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Let testscript stop signalcatcher at the end of the testscript.

signalcatcher &
waitfile catchsignal
7 changes: 6 additions & 1 deletion testscript/testscript.go
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,12 @@ func (ts *TestScript) run() {
for _, bg := range ts.background {
interruptProcess(bg.cmd.Process)
}
ts.cmdWait(false, nil)
func() {
defer catchFailNow(func() {
failed = true
})
ts.cmdWait(false, nil)
}()

// If we reached here but we've failed (probably because ContinueOnError
// was set), don't wipe the log and print "PASS".
Expand Down
Loading