From 43f2fc308b92cec6071a4af225af1dafd4d7ba54 Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Mon, 24 Dec 2012 15:33:32 +0400 Subject: [PATCH] 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 --- src/pkg/runtime/race/race_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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() } -- 2.48.1