]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/race: make test driver print compilation errors
authorDmitriy Vyukov <dvyukov@google.com>
Mon, 24 Dec 2012 11:33:32 +0000 (15:33 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Mon, 24 Dec 2012 11:33:32 +0000 (15:33 +0400)
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

index fac06616fc17acfc89c78bc6612597433dca17b0..c77569c37f48a1e1390bdd45000feeba78b7e718 100644 (file)
@@ -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()
 }