build: add '-count' flag to doTest method

Adds flag -count to ci method doTest. This fla and value
are passed directly to the 'go test' command.
This commit is contained in:
meows 2019-11-20 07:08:53 -05:00
parent 3a4a3d080b
commit 72e9084ee2
No known key found for this signature in database
GPG key ID: F36487257419D94C

View file

@ -319,6 +319,7 @@ func goToolArch(arch string, cc string, subcmd string, args ...string) *exec.Cmd
func doTest(cmdline []string) {
coverage := flag.Bool("coverage", false, "Whether to record code coverage")
verbose := flag.Bool("v", false, "Whether to log verbosely")
count := flag.Int("count", 0, "Run each test n times. Use '1' to idiomatically disable caching.")
flag.CommandLine.Parse(cmdline)
env := build.Env()
@ -338,6 +339,9 @@ func doTest(cmdline []string) {
if *verbose {
gotest.Args = append(gotest.Args, "-v")
}
if *count > 0 {
gotest.Args = append(gotest.Args, fmt.Sprintf("-count=%d", *count))
}
gotest.Args = append(gotest.Args, packages...)
build.MustRun(gotest)