mirror of
https://github.com/golang/go
synced 2024-09-05 16:04:50 +00:00
testing: allow go test -run=^$ testing
This should fix the ssacheck builder. Change-Id: I4b6172df33d6447f7ec8fd8e301c6380efb92588 Reviewed-on: https://go-review.googlesource.com/c/go/+/431336 Auto-Submit: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
parent
0a1118b8a1
commit
1fc83690e6
|
@ -1766,12 +1766,13 @@ func (m *M) Run() (code int) {
|
||||||
m.stopAlarm()
|
m.stopAlarm()
|
||||||
if !testRan && !exampleRan && !fuzzTargetsRan && *matchBenchmarks == "" && *matchFuzz == "" {
|
if !testRan && !exampleRan && !fuzzTargetsRan && *matchBenchmarks == "" && *matchFuzz == "" {
|
||||||
fmt.Fprintln(os.Stderr, "testing: warning: no tests to run")
|
fmt.Fprintln(os.Stderr, "testing: warning: no tests to run")
|
||||||
if testingTesting {
|
if testingTesting && *match != "^$" {
|
||||||
// If this happens during testing of package testing it could be that
|
// If this happens during testing of package testing it could be that
|
||||||
// package testing's own logic for when to run a test is broken,
|
// package testing's own logic for when to run a test is broken,
|
||||||
// in which case every test will run nothing and succeed,
|
// in which case every test will run nothing and succeed,
|
||||||
// with no obvious way to detect this problem (since no tests are running).
|
// with no obvious way to detect this problem (since no tests are running).
|
||||||
// So make 'no tests to run' a hard failure when testing package testing itself.
|
// So make 'no tests to run' a hard failure when testing package testing itself.
|
||||||
|
// The compile-only builders use -run=^$ to run no tests, so allow that.
|
||||||
fmt.Println("FAIL: package testing must run tests")
|
fmt.Println("FAIL: package testing must run tests")
|
||||||
testOk = false
|
testOk = false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue