From: Dmitriy Vyukov Date: Mon, 24 Feb 2014 16:32:28 +0000 (+0400) Subject: testing: diagnose a potential misuse of RunParallel X-Git-Tag: go1.3beta1~609 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1163127def254969c92c20ce0e535690f3b1de4c;p=gostls13.git testing: diagnose a potential misuse of RunParallel LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/68030043 --- diff --git a/src/pkg/testing/benchmark.go b/src/pkg/testing/benchmark.go index e6f3c6d790..06b5b603e3 100644 --- a/src/pkg/testing/benchmark.go +++ b/src/pkg/testing/benchmark.go @@ -417,6 +417,9 @@ func (b *B) RunParallel(body func(*PB)) { }() } wg.Wait() + if n == 0 { + b.Fatal("RunParallel body did not not call PB.Next") + } } // SetParallelism sets the number of goroutines used by RunParallel to p*GOMAXPROCS.