]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: fix negative test filtering
authorMichael Pratt <mpratt@google.com>
Wed, 22 Feb 2017 01:00:10 +0000 (17:00 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 22 Feb 2017 19:09:17 +0000 (19:09 +0000)
std and race bench tests fail to check against t.runRxWant, so what
should be negative filters act as positive filters.

Fixes #19239

Change-Id: Icf02b2192bcd806a162fca9fb0af68a27ccfc936
Reviewed-on: https://go-review.googlesource.com/37336
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/dist/test.go

index c51dcead2b3fd8d47d00a71490145cb61ba7026b..fd011e11935b2b16600a95f3caf0834fa37084c7 100644 (file)
@@ -263,7 +263,7 @@ var (
 
 func (t *tester) registerStdTest(pkg string) {
        testName := "go_test:" + pkg
-       if t.runRx == nil || t.runRx.MatchString(testName) {
+       if t.runRx == nil || t.runRx.MatchString(testName) == t.runRxWant {
                stdMatches = append(stdMatches, pkg)
        }
        t.tests = append(t.tests, distTest{
@@ -299,7 +299,7 @@ func (t *tester) registerStdTest(pkg string) {
 
 func (t *tester) registerRaceBenchTest(pkg string) {
        testName := "go_test_bench:" + pkg
-       if t.runRx == nil || t.runRx.MatchString(testName) {
+       if t.runRx == nil || t.runRx.MatchString(testName) == t.runRxWant {
                benchMatches = append(benchMatches, pkg)
        }
        t.tests = append(t.tests, distTest{