aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/testdata/testprogcgo
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2023-09-01 12:52:48 -0700
committerGopher Robot <gobot@golang.org>2023-09-05 22:43:54 +0000
commitcffdfe8d2cabbe874bceaeed1eba92cc567be6db (patch)
treed4b602cb3c84c6a49f5fe898d1ee9e79b272717b /src/runtime/testdata/testprogcgo
parenta8191789153dcc76abb6a4d3cd4e56e2d68c2430 (diff)
downloadgo-cffdfe8d2cabbe874bceaeed1eba92cc567be6db.tar.xz
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 <iant@google.com> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/runtime/testdata/testprogcgo')
-rw-r--r--src/runtime/testdata/testprogcgo/threadprof.go4
1 files changed, 3 insertions, 1 deletions
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)