From 091ef25a5e8e958dc31c11dd5f281cc9d91ccc66 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 10 Jan 2012 20:13:02 -0800 Subject: [PATCH] go: rely on exit code to tell if test passed R=adg, dsymonds CC=golang-dev https://golang.org/cl/5532066 --- src/cmd/go/test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cmd/go/test.go b/src/cmd/go/test.go index dd7ce46fa1..b707cab1dc 100644 --- a/src/cmd/go/test.go +++ b/src/cmd/go/test.go @@ -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) -- 2.50.0