Skip to content

testing: no tests to run warning when running benchmarks #17603

Description

@mvdan

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version devel +517a44d Tue Oct 25 12:23:49 2016 +0000 linux/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/mvdan/go"
GORACE=""
GOROOT="/home/mvdan/tip"
GOTOOLDIR="/home/mvdan/tip/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build943520682=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

go test -run='^$' -bench=. on a package of mine with benchmarks.

What did you expect to see?

 $ go test -run='^$' -bench=.
BenchmarkFprint-4         300000              5056 ns/op
PASS
ok      github.com/mvdan/sh/printer     1.574s

What did you see instead?

 $ go test -run='^$' -bench=.
testing: warning: no tests to run
BenchmarkFprint-4         300000              5056 ns/op
PASS
ok      github.com/mvdan/sh/printer     1.574s [no tests to run]

The [no tests to run] doesn't bother me, but the extra line at the beginning does. I think this should be turned off if any benchmarks are run.

Happy to submit a patch today if this makes sense.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions