From: Dmitriy Vyukov Date: Thu, 21 Jul 2011 15:31:07 +0000 (-0400) Subject: testing: output benchmark name before executing it X-Git-Tag: weekly.2011-07-29~99 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c3a86dab36dfbe3ae6a36832ddf3e96ae3175baa;p=gostls13.git testing: output benchmark name before executing it It makes it clear what benchmark is currently running. Especially useful in case of hangup or crash. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4816043 --- diff --git a/src/pkg/testing/benchmark.go b/src/pkg/testing/benchmark.go index 3b416acfaf..fd0bd86657 100644 --- a/src/pkg/testing/benchmark.go +++ b/src/pkg/testing/benchmark.go @@ -214,12 +214,13 @@ func RunBenchmarks(matchString func(pat, str string) (bool, os.Error), benchmark for _, procs := range cpuList { runtime.GOMAXPROCS(procs) b := &B{benchmark: Benchmark} - r := b.run() benchName := Benchmark.Name if procs != 1 { benchName = fmt.Sprintf("%s-%d", Benchmark.Name, procs) } - print(fmt.Sprintf("%s\t%v\n", benchName, r)) + print(fmt.Sprintf("%s\t", benchName)) + r := b.run() + print(fmt.Sprintf("%v\n", r)) if p := runtime.GOMAXPROCS(-1); p != procs { print(fmt.Sprintf("%s left GOMAXPROCS set to %d\n", benchName, p)) }