diff options
Diffstat (limited to 'src/runtime/crash_test.go')
-rw-r--r-- | src/runtime/crash_test.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/runtime/crash_test.go b/src/runtime/crash_test.go index 8f11333b462..53f7028882d 100644 --- a/src/runtime/crash_test.go +++ b/src/runtime/crash_test.go @@ -24,10 +24,21 @@ import ( var toRemove []string func TestMain(m *testing.M) { + _, coreErrBefore := os.Stat("core") + status := m.Run() for _, file := range toRemove { os.RemoveAll(file) } + + _, coreErrAfter := os.Stat("core") + if coreErrBefore != nil && coreErrAfter == nil { + fmt.Fprintln(os.Stderr, "runtime.test: some test left a core file behind") + if status == 0 { + status = 1 + } + } + os.Exit(status) } |