(t *testing.T, main string, disableInline bool)
| 1617 | } |
| 1618 | |
| 1619 | func 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. |
| 1637 | func zapPointers(t *testing.T, want, got *Stack) { |
no test coverage detected
searching dependent graphs…