MCPcopy Index your code
hub / github.com/maruel/panicparse / getCrash

Function getCrash

stack/source_test.go:1619–1634  ·  view source on GitHub ↗
(t *testing.T, main string, disableInline bool)

Source from the content-addressed store, hash-verified

1617}
1618
1619func getCrash(t *testing.T, main string, disableInline bool) []byte {
1620 args := []string{"run"}
1621 if disableInline {
1622 // Disable both optimization (-N) and inlining (-l).
1623 args = append(args, "-gcflags", "-N -l")
1624 }
1625 cmd := exec.Command("go", append(args, main)...)
1626 // Use the Go 1.4 compatible format.
1627 cmd.Env = overrideEnv(os.Environ(), "GOTRACEBACK", "1")
1628 out, err := cmd.CombinedOutput()
1629 if err == nil {
1630 t.Helper()
1631 t.Fatal("expected error since this is supposed to crash")
1632 }
1633 return out
1634}
1635
1636// zapPointers zaps out pointers in got.
1637func zapPointers(t *testing.T, want, got *Stack) {

Callers 1

TestAugmentFunction · 0.85

Calls 1

overrideEnvFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…