]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: consolidate runtime CPU tests
authorJosh Bleecher Snyder <josharian@gmail.com>
Sat, 25 Apr 2015 00:06:52 +0000 (17:06 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 27 Apr 2015 17:36:18 +0000 (17:36 +0000)
Instead of running:

go test -short runtime -cpu=1
go test -short runtime -cpu=2
go test -short runtime -cpu=4

Run just:

go test -short runtime -cpu=1,2,4

This is a return to the Go 1.4.2 behavior.

We lose incremental display of progress and
per-cpu timing information, but we don't have
to recompile and relink the runtime test,
which is slow.

This cuts about 10s off all.bash.

Updates #10571.

Change-Id: I6e8c7149780d47439f8bcfa888e6efc84290c60a
Reviewed-on: https://go-review.googlesource.com/9350
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
src/cmd/dist/test.go

index 112e40a0f3624992b9bc9a5f5459c7ec7e29fb3c..7ffe5d6f6291302f06830ac47f686acb920df026 100644 (file)
@@ -199,21 +199,18 @@ func (t *tester) registerTests() {
        }
 
        // Runtime CPU tests.
-       for _, cpu := range []string{"1", "2", "4"} {
-               cpu := cpu
-               testName := "runtime:cpu" + cpu
-               t.tests = append(t.tests, distTest{
-                       name:    testName,
-                       heading: "GOMAXPROCS=2 runtime -cpu=1,2,4",
-                       fn: func() error {
-                               cmd := t.dirCmd("src", "go", "test", "-short", t.timeout(300), "runtime", "-cpu="+cpu)
-                               // We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code,
-                               // creation of first goroutines and first garbage collections in the parallel setting.
-                               cmd.Env = mergeEnvLists([]string{"GOMAXPROCS=2"}, os.Environ())
-                               return cmd.Run()
-                       },
-               })
-       }
+       testName := "runtime:cpu124"
+       t.tests = append(t.tests, distTest{
+               name:    testName,
+               heading: "GOMAXPROCS=2 runtime -cpu=1,2,4",
+               fn: func() error {
+                       cmd := t.dirCmd("src", "go", "test", "-short", t.timeout(300), "runtime", "-cpu=1,2,4")
+                       // We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code,
+                       // creation of first goroutines and first garbage collections in the parallel setting.
+                       cmd.Env = mergeEnvLists([]string{"GOMAXPROCS=2"}, os.Environ())
+                       return cmd.Run()
+               },
+       })
 
        // sync tests
        t.tests = append(t.tests, distTest{