diff --git a/testscript/exe.go b/testscript/exe.go index ed6bd98d..1305b06e 100644 --- a/testscript/exe.go +++ b/testscript/exe.go @@ -12,6 +12,7 @@ import ( "path/filepath" "runtime" "strings" + "time" ) // TestingM is implemented by *testing.M. It's defined as an interface @@ -97,6 +98,13 @@ func RunMain(m TestingM, commands map[string]func() int) (exitCode int) { ts.cmdExec(neg, append([]string{name}, args...)) } } + + if runtime.GOOS == "darwin" { + // Make sure all of the io operations above gets some time to complete. + // See issue #200. + time.Sleep(200 * time.Millisecond) + } + return m.Run() } // The command being registered is being invoked, so run it, then exit.