From cffdfe8d2cabbe874bceaeed1eba92cc567be6db Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 1 Sep 2023 12:52:48 -0700 Subject: runtime: don't let the tests leave core files behind Also add a check that we didn't leave any core files behind. Change-Id: I30444ef43ad1a8cc1cacd3b75280f2128e104939 Reviewed-on: https://go-review.googlesource.com/c/go/+/525175 Reviewed-by: Ian Lance Taylor Reviewed-by: Keith Randall Auto-Submit: Ian Lance Taylor Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI Reviewed-by: Keith Randall --- src/runtime/testdata/testprogcgo/threadprof.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/runtime/testdata') diff --git a/src/runtime/testdata/testprogcgo/threadprof.go b/src/runtime/testdata/testprogcgo/threadprof.go index d62d4b4be8..00b511d23b 100644 --- a/src/runtime/testdata/testprogcgo/threadprof.go +++ b/src/runtime/testdata/testprogcgo/threadprof.go @@ -92,7 +92,9 @@ func CgoExternalThreadSignal() { return } - out, err := exec.Command(os.Args[0], "CgoExternalThreadSignal", "crash").CombinedOutput() + cmd := exec.Command(os.Args[0], "CgoExternalThreadSignal", "crash") + cmd.Dir = os.TempDir() // put any core file in tempdir + out, err := cmd.CombinedOutput() if err == nil { fmt.Println("C signal did not crash as expected") fmt.Printf("\n%s\n", out) -- cgit v1.3