]> Cypherpunks repositories - gostls13.git/commitdiff
build: use run.go for running tests
authorRuss Cox <rsc@golang.org>
Tue, 6 Mar 2012 03:47:23 +0000 (22:47 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 6 Mar 2012 03:47:23 +0000 (22:47 -0500)
Also, tweak run.go to use no more than 2x the
number of CPUs, and only one on ARM.

53.85u 13.33s 53.69r   ./run
50.68u 12.13s 18.85r   go run run.go

Fixes #2833.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5754047

src/run.bash
src/run.bat
test/run.go

index fdbf47663bbb9b7719588e82adfbf416bd457627..7b1854865ef34102060687d80e8808fd567e4c02 100755 (executable)
@@ -105,7 +105,7 @@ $BROKEN ||
 ) || exit $?
 
 (xcd ../test
-./run
+time go run run.go
 ) || exit $?
 
 echo
index 9f2af3978b53eb6a1ca5d384d2350e5efe740d0e..f1eebe374a3973ea28118b68696c20e3a8edc1ef 100644 (file)
@@ -36,7 +36,14 @@ go test sync -short -timeout=120s -cpu=10
 if errorlevel 1 goto fail
 echo.
 
-:: TODO: The other tests in run.bash, especially $GOROOT/test/run.
+:: TODO: The other tests in run.bash.
+
+echo # test
+cd test
+go run run.go
+cd ..
+if errorlevel 1 goto fail
+echo.
 
 echo ALL TESTS PASSED
 goto end
index 050cfadb2c63117e07fc55904eb0c22b3d8d2bac..f0b2555db07d6f8d336889d070a7697cbf7d090f 100644 (file)
@@ -30,7 +30,7 @@ import (
 
 var (
        verbose     = flag.Bool("v", false, "verbose. if set, parallelism is set to 1.")
-       numParallel = flag.Int("n", 8, "number of parallel tests to run")
+       numParallel = flag.Int("n", 2*runtime.NumCPU(), "number of parallel tests to run")
        summary     = flag.Bool("summary", false, "show summary of results")
        showSkips   = flag.Bool("show_skips", false, "show skipped tests")
 )
@@ -60,7 +60,10 @@ const maxTests = 5000
 
 func main() {
        flag.Parse()
-       if *verbose {
+       
+       // Disable parallelism if printing, or if running on
+       // (presumably underpowered) arm systems.
+       if *verbose || runtime.GOARCH == "arm" {
                *numParallel = 1
        }