From: Dmitriy Vyukov Date: Mon, 24 Dec 2012 11:33:32 +0000 (+0400) Subject: runtime/race: make test driver print compilation errors X-Git-Tag: go1.1rc2~1534 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=43f2fc308b92cec6071a4af225af1dafd4d7ba54;p=gostls13.git runtime/race: make test driver print compilation errors Currently it silently "succeeds" saying that it run 0 tests if there are compilations errors. With this change it fails and outputs the compilation error. R=golang-dev, remyoudompheng CC=golang-dev https://golang.org/cl/7002058 --- diff --git a/src/pkg/runtime/race/race_test.go b/src/pkg/runtime/race/race_test.go index fac06616fc..c77569c37f 100644 --- a/src/pkg/runtime/race/race_test.go +++ b/src/pkg/runtime/race/race_test.go @@ -42,7 +42,7 @@ const ( func TestRace(t *testing.T) { testOutput, err := runTests() if err != nil { - t.Fatalf("Failed to run tests: %v", err) + t.Fatalf("Failed to run tests: %v\n%v", err, string(testOutput)) } reader := bufio.NewReader(bytes.NewBuffer(testOutput)) @@ -152,7 +152,6 @@ func runTests() ([]byte, error) { } cmd.Env = append(cmd.Env, env) } - cmd.Env = append(cmd.Env, `GORACE="suppress_equal_stacks=0 suppress_equal_addresses=0"`) - ret, _ := cmd.CombinedOutput() - return ret, nil + cmd.Env = append(cmd.Env, `GORACE="suppress_equal_stacks=0 suppress_equal_addresses=0 exitcode=0"`) + return cmd.CombinedOutput() }