Commit 43f2fc30 authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

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
parent ecbf99ad
...@@ -42,7 +42,7 @@ const ( ...@@ -42,7 +42,7 @@ const (
func TestRace(t *testing.T) { func TestRace(t *testing.T) {
testOutput, err := runTests() testOutput, err := runTests()
if err != nil { 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)) reader := bufio.NewReader(bytes.NewBuffer(testOutput))
...@@ -152,7 +152,6 @@ func runTests() ([]byte, error) { ...@@ -152,7 +152,6 @@ func runTests() ([]byte, error) {
} }
cmd.Env = append(cmd.Env, env) cmd.Env = append(cmd.Env, env)
} }
cmd.Env = append(cmd.Env, `GORACE="suppress_equal_stacks=0 suppress_equal_addresses=0"`) cmd.Env = append(cmd.Env, `GORACE="suppress_equal_stacks=0 suppress_equal_addresses=0 exitcode=0"`)
ret, _ := cmd.CombinedOutput() return cmd.CombinedOutput()
return ret, nil
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment