...

Text file src/cmd/go/testdata/script/test_benchmark_labels.txt

Documentation: cmd/go/testdata/script

     1# Tests that go test -bench prints out goos, goarch, and pkg.
     2
     3# Check for goos, goarch, and pkg.
     4go test -run ^$ -bench . bench
     5stdout '^goos: '$GOOS
     6stdout '^goarch: '$GOARCH
     7stdout '^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 --
    14module bench
    15
    16go 1.16
    17-- x_test.go --
    18package bench
    19
    20import "testing"
    21
    22func Benchmark(b *testing.B) {
    23}

View as plain text