From 72e9084ee2cdf468f932d290b8278ef16e215fad Mon Sep 17 00:00:00 2001 From: meows Date: Wed, 20 Nov 2019 07:08:53 -0500 Subject: [PATCH] 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. --- build/ci.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/ci.go b/build/ci.go index 1635202413..ef4adea01b 100644 --- a/build/ci.go +++ b/build/ci.go @@ -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)