Skip to content

Commit

Permalink
Add --benchtime flag to gopherjs test. (#578)
Browse files Browse the repository at this point in the history
It operates like the same flag of go test command.
  • Loading branch information
flimzy authored and dmitshur committed Jan 28, 2017
1 parent 2967252 commit 5c8f217
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tool.go
Expand Up @@ -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.")
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 5c8f217

Please sign in to comment.