src/cmd/go/testdata/script/test_benchmark_labels.txt
raw| 1 | # Tests that go test -bench prints out goos, goarch, and pkg. |
| 2 | |
| 3 | # Check for goos, goarch, and pkg. |
| 4 | go test -run ^$ -bench . bench |
| 5 | stdout '^goos: '$GOOS |
| 6 | stdout '^goarch: '$GOARCH |
| 7 | stdout '^pkg: bench' |
| 8 | |
| 9 | # Check go test does not print pkg multiple times |
| 10 | ! stdout 'pkg:.*pkg: ' |
| 11 | ! stderr 'pkg:.*pkg:' |
| 12 | |
| 13 | -- go.mod -- |
| 14 | module bench |
| 15 | |
| 16 | go 1.16 |
| 17 | -- x_test.go -- |
| 18 | package bench |
| 19 | |
| 20 | import "testing" |
| 21 | |
| 22 | func Benchmark(b *testing.B) { |
| 23 | } |