Skip to content

Commit

Permalink
testscript: handle the "fail now!" panic in cmdWait
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed May 13, 2023
1 parent a4f6fab commit 98bb3d5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions testscript/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,11 @@ func (ts *TestScript) cmdUNIX2DOS(neg bool, args []string) {

// Tait waits for background commands to exit, setting stderr and stdout to their result.
func (ts *TestScript) cmdWait(neg bool, args []string) {
defer catchFailNow(func() {
// There's been a failure in setup; fail immediately regardless
// of the ContinueOnError flag.
ts.t.FailNow()
})
if len(args) > 1 {
ts.Fatalf("usage: wait [name]")
}
Expand Down

0 comments on commit 98bb3d5

Please sign in to comment.