tplimpl: Make partial benchmarks use RunParallel

See #4086
This commit is contained in:
Bjørn Erik Pedersen 2017-11-16 01:13:07 +01:00
parent bb048d811d
commit 7730d683e8
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -194,11 +194,13 @@ func doBenchmarkPartial(b *testing.B, f func(ns *partials.Namespace) error) {
ns := partials.New(de)
b.ResetTimer()
for i := 0; i < b.N; i++ {
if err := f(ns); err != nil {
b.Fatalf("error executing template: %s", err)
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
if err := f(ns); err != nil {
b.Fatalf("error executing template: %s", err)
}
}
}
})
}
func newTestFuncster() *templateFuncster {