go.tools/cmd/vet: attempt to fix build

Can't reproduce the failure outside the builder, but attempt a fix
by changing the criterion for failure: FAIL iff the output contains "BUG".

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/9798050
This commit is contained in:
Rob Pike 2013-05-29 11:28:19 -04:00
parent 2b48cfca08
commit f91ca66179

View File

@ -5,6 +5,7 @@
package main_test package main_test
import ( import (
"bytes"
"os" "os"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
@ -63,5 +64,9 @@ func run(c *exec.Cmd, t *testing.T) bool {
t.Fatal(err) t.Fatal(err)
} }
// Errchk delights by not returning non-zero status if it finds errors, so we look at the output. // Errchk delights by not returning non-zero status if it finds errors, so we look at the output.
return c.ProcessState.Success() && len(output) == 0 // It prints "BUG" if there is a failure.
if !c.ProcessState.Success() {
return false
}
return !bytes.Contains(output, []byte("BUG"))
} }