sweet: allow zero runs of benchmarks This CL allows the user to only compile the benchmarks. I found this useful when I am only collecting compilation statistics. Context: CL 711260. Change-Id: If615759f2ac2f3fa30839accdfb6fcbb2100ecfa Reviewed-on: https://go-review.googlesource.com/c/benchmarks/+/724920 Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/sweet/cmd/sweet/run.go b/sweet/cmd/sweet/run.go index 9a415ec..b8388e7 100644 --- a/sweet/cmd/sweet/run.go +++ b/sweet/cmd/sweet/run.go
@@ -148,7 +148,7 @@ f.BoolVar(&c.runCfg.dumpCore, "dump-core", false, "whether to dump core files for each benchmark process when it completes a benchmark") f.BoolVar(&c.pgo, "pgo", false, "perform PGO testing; for each config, collect profiles from a baseline run which are used to feed into a generated PGO config") f.IntVar(&c.runCfg.pgoCount, "pgo-count", 0, "the number of times to run profiling runs for -pgo; defaults to the value of -count if <=5, or 5 if higher") - f.IntVar(&c.runCfg.count, "count", 0, fmt.Sprintf("the number of times to run each benchmark (default %d)", countDefault)) + f.IntVar(&c.runCfg.count, "count", -1, fmt.Sprintf("the number of times to run each benchmark (default %d)", countDefault)) f.BoolVar(&c.quiet, "quiet", false, "whether to suppress activity output on stderr (no effect on -shell)") f.BoolVar(&c.printCmd, "shell", false, "whether to print the commands being executed to stdout") @@ -166,7 +166,7 @@ log.SetCommandTrace(c.printCmd) log.SetActivityLog(!c.quiet) - if c.runCfg.count == 0 { + if c.runCfg.count == -1 { if c.short { c.runCfg.count = 1 } else {