Commit 5e41fe0e authored by Russ Cox's avatar Russ Cox

build: use run.go for running tests

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
parent 4e110af1
......@@ -105,7 +105,7 @@ $BROKEN ||
) || exit $?
(xcd ../test
./run
time go run run.go
) || exit $?
echo
......
......@@ -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
......
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment