Permalink
Browse files

Add --benchtime flag to gopherjs test. (#578)

It operates like the same flag of go test command.
  • Loading branch information...
1 parent 2967252 commit 5c8f21741620ef6a52e185bbc920499581901c9e @flimzy flimzy committed with shurcooL Jan 28, 2017
Showing with 4 additions and 0 deletions.
  1. +4 −0 tool.go
View
@@ -310,6 +310,7 @@ func main() {
Short: "test packages",
}
bench := cmdTest.Flags().String("bench", "", "Run benchmarks matching the regular expression. By default, no benchmarks run. To run all benchmarks, use '--bench=.'.")
+ benchtime := cmdTest.Flags().String("benchtime", "", "Run enough iterations of each benchmark to take t, specified as a time.Duration (for example, -benchtime 1h30s). The default is 1 second (1s).")
run := cmdTest.Flags().String("run", "", "Run only those tests and examples matching the regular expression.")
short := cmdTest.Flags().Bool("short", false, "Tell long-running tests to shorten their run time.")
verbose := cmdTest.Flags().BoolP("verbose", "v", false, "Log all tests as they are run. Also print all text from Log and Logf calls even if the test succeeds.")
@@ -472,6 +473,9 @@ func main() {
if *bench != "" {
args = append(args, "-test.bench", *bench)
}
+ if *benchtime != "" {
+ args = append(args, "-test.benchtime", *benchtime)
+ }
if *run != "" {
args = append(args, "-test.run", *run)
}

0 comments on commit 5c8f217

Please sign in to comment.