]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: "go test -c -test.bench=XX fmt" shouldn't hang
authorShenghou Ma <minux.ma@gmail.com>
Wed, 25 Sep 2013 20:18:33 +0000 (16:18 -0400)
committerShenghou Ma <minux.ma@gmail.com>
Wed, 25 Sep 2013 20:18:33 +0000 (16:18 -0400)
Fixes #6480.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/13925043

src/cmd/go/test.bash
src/cmd/go/test.go

index c5effe757e4fbf63420035897e73d5be789ca3db..f71d678182f4039de521edbf30e08b945a644db2 100755 (executable)
@@ -408,7 +408,7 @@ if ! grep -q '^hello world' hello.out; then
        cat hello.out
        ok=false
 fi
-rm -rf $d
+rm -rf $d hello.out
 
 TEST go test -cpuprofile leaves binary behind
 ./testgo test -cpuprofile strings.prof strings || ok=false
@@ -613,6 +613,13 @@ fi
 rm -rf $d
 unset GOPATH
 
+TEST 'Issue 6480: "go test -c -test.bench=XXX fmt" should not hang'
+if ! ./testgo test -c -test.bench=XXX fmt; then
+       echo build test failed
+       ok=false
+fi
+rm -f fmt.test
+
 # clean up
 if $started; then stop; fi
 rm -rf testdata/bin testdata/bin1
index eab075db7c33f83f01ab8c965bdaebf9953ee377..06ac9d206299dbae590c9e70144280d44cbc2a54 100644 (file)
@@ -449,7 +449,7 @@ func runTest(cmd *Command, args []string) {
        }
 
        // Force benchmarks to run in serial.
-       if testBench {
+       if !testC && testBench {
                // The first run must wait for all builds.
                // Later runs must wait for the previous run's print.
                for i, run := range runs {