1
0
mirror of https://github.com/golang/go synced 2024-11-20 01:54:41 -07:00
go/src/testing
Daniel Martí 86dde2debb testing: error if -parallel is given N<1
Otherwise, if there are any parallel tests, it will hang and panic with
"all goroutines are asleep - deadlock!".

Do not use flag.Uint to handle the error for us because we also want to
error on N==0, and because it would make setting the default to
GOMAXPROCS(0) more difficult, since it's an int.

Check for it right after flag.Parse, and mimic flag errors by printing
the usage and returning exit code 2.

Fixes #20542.

Change-Id: I0c9d4587f83d406a8f5e42ed74e40be46d639ffb
Reviewed-on: https://go-review.googlesource.com/54150
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-08-25 22:47:57 +00:00
..
internal/testdeps testing: print extra labels on benchmarks 2017-02-07 00:08:39 +00:00
iotest
quick doc: mention testing/quick RNG seeding change in Go 1.9 notes 2017-06-27 22:41:49 +00:00
allocs_test.go
allocs.go
benchmark_test.go
benchmark.go testing: parallelize tests over count 2017-08-24 05:45:17 +00:00
cover.go
example.go
export_test.go
helper_test.go testing: add TB.Helper to better support test helpers 2017-04-14 16:47:25 +00:00
helperfuncs_test.go testing: add TB.Helper to better support test helpers 2017-04-14 16:47:25 +00:00
match_test.go testing: harmonize handling of prefix-matched benchmarks 2017-06-20 14:19:05 +00:00
match.go testing: harmonize handling of prefix-matched benchmarks 2017-06-20 14:19:05 +00:00
sub_test.go testing: always ReadMemStats before first benchmark run 2017-06-28 20:47:26 +00:00
testing_test.go
testing.go testing: error if -parallel is given N<1 2017-08-25 22:47:57 +00:00