Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing: `go test -run` should warn user if there are no tests to run #7893

Closed
gopherbot opened this issue Apr 29, 2014 · 3 comments
Closed

testing: `go test -run` should warn user if there are no tests to run #7893

gopherbot opened this issue Apr 29, 2014 · 3 comments
Milestone

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Apr 29, 2014

by guohouzuo:

`go test` generates a very useful warning when there are no tests to run:

    > go test
    testing: warning: no tests to run
    PASS
    ok  mypkg  0.010s

However, the behaviour is different when `-run` flag is involved:

    > go test -run=DoesNotExist
    PASS
    ok   mypkg   0.011s

It will be really useful to suggest user of his/her mistake in the second case (with
-run flag).

Thanks.
@minux

This comment has been minimized.

Copy link
Member

@minux minux commented Apr 29, 2014

Comment 1:

https://golang.org/cl/90900043

Labels changed: added release-go1.4, repo-main.

Owner changed to @minux.

Status changed to Accepted.

@nathany

This comment has been minimized.

Copy link
Contributor

@nathany nathany commented Jun 28, 2014

Comment 2:

Just ran into this too.
I discovered this on a test file named *_test_darwin.go instead of *_darwin_test.go. It
seemed like it was working (PASS), but that test wasn't running at all.
@rsc

This comment has been minimized.

Copy link
Contributor

@rsc rsc commented Sep 18, 2014

Comment 3:

I use things like 'go test -run=XXX' all the time. I don't really want a warning there.
I think this is fine as is.

Owner changed to ---.

Status changed to WorkingAsIntended.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.