go/src/testing
Martin Möhrmann b7a2d413a3 testing: print cpu type as label for benchmarks
Supports 386 and amd64 architectures on all operating systems.

Example output:
$ go test -bench=.*
goos: darwin
goarch: amd64
pkg: strconv
cpu: Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
BenchmarkAtof64Decimal-4        	24431032	        46.8 ns/op
...

As the displayed CPU information is only used for information
purposes it is lazily initialized when needed using the new
internal/sysinfo package.

This allows internal/cpu to stay without dependencies and avoid
initialization costs when the CPU information is not needed as
the new code to query the CPU name in internal/cpu can be
dead code eliminated if not used.

Fixes #39214

Change-Id: I77ae5c5d2fed6b28fa78dd45075f9f0a6a7f1bfd
Reviewed-on: https://go-review.googlesource.com/c/go/+/263804
Trust: Martin Möhrmann <moehrmann@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
2020-10-20 21:30:18 +00:00
..
fstest io/fs: add Glob and GlobFS 2020-10-20 17:53:14 +00:00
internal/testdeps cmd/go, testing, os: fail test that calls os.Exit(0) 2020-08-27 23:19:15 +00:00
iotest all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
quick all: shorten some tests 2019-05-22 12:54:00 +00:00
allocs.go
allocs_test.go
benchmark.go testing: print cpu type as label for benchmarks 2020-10-20 21:30:18 +00:00
benchmark_test.go testing: shorten go test -short testing 2019-05-16 03:25:08 +00:00
cover.go testing/cover: improve message when a package has no statements 2019-03-13 04:11:58 +00:00
example.go testing: fail Example tests that invoke runtime.Goexit 2020-09-01 20:13:34 +00:00
export_test.go testing: stop rounding b.N 2019-03-20 21:19:16 +00:00
helper_test.go testing: add benchmark for TB.Helper 2020-09-28 20:51:39 +00:00
helperfuncs_test.go testing: fix reported caller name for funcs passed to Cleanup 2020-05-05 22:44:36 +00:00
match.go testing: fix typo mistake 2018-04-27 13:29:12 +00:00
match_test.go
panic_test.go testing: don't run Cleanup functions until parallel subtests complete 2020-01-16 21:32:12 +00:00
run_example.go testing: fail Example tests that invoke runtime.Goexit 2020-09-01 20:13:34 +00:00
run_example_js.go testing: fail Example tests that invoke runtime.Goexit 2020-09-01 20:13:34 +00:00
sub_test.go testing: flush test summaries to stdout atomically when streaming output 2020-09-02 14:22:42 +00:00
testing.go testing: send t.signal only if there is no panic 2020-09-24 19:32:05 +00:00
testing_test.go testing: make TempDir idempotent for both Cleanup and Benchmark 2020-09-05 04:21:49 +00:00