mirror of
https://github.com/golang/go
synced 2024-11-25 05:57:57 -07:00
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
This commit is contained in:
parent
d2ab2b9f42
commit
c3a86dab36
@ -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))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user