]> Cypherpunks repositories - gostls13.git/commitdiff
go: rely on exit code to tell if test passed
authorRuss Cox <rsc@golang.org>
Wed, 11 Jan 2012 04:13:02 +0000 (20:13 -0800)
committerRuss Cox <rsc@golang.org>
Wed, 11 Jan 2012 04:13:02 +0000 (20:13 -0800)
R=adg, dsymonds
CC=golang-dev
https://golang.org/cl/5532066

src/cmd/go/test.go

index dd7ce46fa193a41d2eadfc1c4ac2431e7b461a7c..b707cab1dc797057f14d476f43bcdeda5025198f 100644 (file)
@@ -440,8 +440,6 @@ func (b *builder) test(p *Package) (buildAction, runAction, printAction *action,
        return pmainAction, runAction, printAction, nil
 }
 
-var pass = []byte("\nPASS\n")
-
 // runTest is the action for running a test binary.
 func (b *builder) runTest(a *action) error {
        args := []string{a.deps[0].target}
@@ -469,7 +467,7 @@ func (b *builder) runTest(a *action) error {
        out, err := cmd.CombinedOutput()
        t1 := time.Now()
        t := fmt.Sprintf("%.3fs", t1.Sub(t0).Seconds())
-       if err == nil && (bytes.Equal(out, pass[1:]) || bytes.HasSuffix(out, pass)) {
+       if err == nil {
                fmt.Fprintf(a.testOutput, "ok  \t%s\t%s\n", a.p.ImportPath, t)
                if testShowPass {
                        a.testOutput.Write(out)