if noRebuild {
t.rebuild = false
}
+
t.run()
}
}
}
+ // Set GOTRACEBACK to system if the user didn't set a level explicitly.
+ // Since we're running tests for Go, we want as much detail as possible
+ // if something goes wrong.
+ //
+ // Set it before running any commands just in case something goes wrong.
+ if ok := isEnvSet("GOTRACEBACK"); !ok {
+ if err := os.Setenv("GOTRACEBACK", "system"); err != nil {
+ if t.keepGoing {
+ log.Printf("Failed to set GOTRACEBACK: %v", err)
+ } else {
+ fatalf("Failed to set GOTRACEBACK: %v", err)
+ }
+ }
+ }
+
if t.rebuild {
t.out("Building packages and commands.")
// Force rebuild the whole toolchain.
unsupportedVMA := []byte("unsupported VMA range")
return w.dt.name == "race" && bytes.Contains(w.out, unsupportedVMA)
}
+
+// isEnvSet reports whether the environment variable evar is
+// set in the environment.
+func isEnvSet(evar string) bool {
+ evarEq := evar + "="
+ for _, e := range os.Environ() {
+ if strings.HasPrefix(e, evarEq) {
+ return true
+ }
+ }
+ return false
+}
"GOPRIVATE=",
"GOROOT=" + testGOROOT,
"GOROOT_FINAL=" + os.Getenv("GOROOT_FINAL"), // causes spurious rebuilds and breaks the "stale" built-in if not propagated
- "GOTRACEBACK=all",
+ "GOTRACEBACK=system",
"TESTGO_GOROOT=" + testGOROOT,
"GOSUMDB=" + testSumDBVerifierKey,
"GONOPROXY=",