mirror of
https://github.com/golang/go
synced 2024-11-24 21:00:09 -07:00
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
This commit is contained in:
parent
4e110af169
commit
5e41fe0e45
@ -105,7 +105,7 @@ $BROKEN ||
|
|||||||
) || exit $?
|
) || exit $?
|
||||||
|
|
||||||
(xcd ../test
|
(xcd ../test
|
||||||
./run
|
time go run run.go
|
||||||
) || exit $?
|
) || exit $?
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
@ -36,7 +36,14 @@ go test sync -short -timeout=120s -cpu=10
|
|||||||
if errorlevel 1 goto fail
|
if errorlevel 1 goto fail
|
||||||
echo.
|
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
|
echo ALL TESTS PASSED
|
||||||
goto end
|
goto end
|
||||||
|
@ -30,7 +30,7 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
verbose = flag.Bool("v", false, "verbose. if set, parallelism is set to 1.")
|
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")
|
summary = flag.Bool("summary", false, "show summary of results")
|
||||||
showSkips = flag.Bool("show_skips", false, "show skipped tests")
|
showSkips = flag.Bool("show_skips", false, "show skipped tests")
|
||||||
)
|
)
|
||||||
@ -60,7 +60,10 @@ const maxTests = 5000
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
if *verbose {
|
|
||||||
|
// Disable parallelism if printing, or if running on
|
||||||
|
// (presumably underpowered) arm systems.
|
||||||
|
if *verbose || runtime.GOARCH == "arm" {
|
||||||
*numParallel = 1
|
*numParallel = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user