Run unit tests concurrently by default.

This change makes util/all_tests.go run as many test binaries
concurrently as there are cores on the current system. This can be
overridden with -num-workers=1.

Change-Id: Ia3a5e336d208039be9276261a0ac03f7fb774677
Reviewed-on: https://boringssl-review.googlesource.com/14927
Reviewed-by: Adam Langley <agl@google.com>
This commit is contained in:
Adam Langley 2017-04-11 17:07:27 -07:00
parent 7e06de5d2d
commit 31fa5a446a

View File

@ -22,6 +22,7 @@ import (
"os"
"os/exec"
"path"
"runtime"
"strconv"
"strings"
"sync"
@ -37,7 +38,7 @@ var (
useGDB = flag.Bool("gdb", false, "If true, run BoringSSL code under gdb")
useSDE = flag.Bool("sde", false, "If true, run BoringSSL code under Intel's SDE for each supported chip")
buildDir = flag.String("build-dir", "build", "The build directory to run the tests from.")
numWorkers = flag.Int("num-workers", 1, "Runs the given number of workers when testing.")
numWorkers = flag.Int("num-workers", runtime.NumCPU(), "Runs the given number of workers when testing.")
jsonOutput = flag.String("json-output", "", "The file to output JSON results to.")
mallocTest = flag.Int64("malloc-test", -1, "If non-negative, run each test with each malloc in turn failing from the given number onwards.")
mallocTestDebug = flag.Bool("malloc-test-debug", false, "If true, ask each test to abort rather than fail a malloc. This can be used with a specific value for --malloc-test to identity the malloc failing that is causing problems.")