mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: test trap panic parsing in TestTracebackSystem
This mirrors https://go.dev/cl/637755, as x/telemetry is now aware of sigpanic preceding trap frames. For #70637. Change-Id: I13a775f25e89047702d4f2d463ce3210bcf192d9 Reviewed-on: https://go-review.googlesource.com/c/go/+/638015 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
e63eb98e98
commit
45f49139f5
2 changed files with 204 additions and 56 deletions
|
|
@ -32,8 +32,11 @@ const entrypointVar = "RUNTIME_TEST_ENTRYPOINT"
|
|||
|
||||
func TestMain(m *testing.M) {
|
||||
switch entrypoint := os.Getenv(entrypointVar); entrypoint {
|
||||
case "crash":
|
||||
crash()
|
||||
case "panic":
|
||||
crashViaPanic()
|
||||
panic("unreachable")
|
||||
case "trap":
|
||||
crashViaTrap()
|
||||
panic("unreachable")
|
||||
default:
|
||||
log.Fatalf("invalid %s: %q", entrypointVar, entrypoint)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue