|
@@ -91,6 +91,7 @@ type testMatcher struct {
|
|
|
failpat []testFailure
|
|
failpat []testFailure
|
|
|
skiploadpat []*regexp.Regexp
|
|
skiploadpat []*regexp.Regexp
|
|
|
skipshortpat []*regexp.Regexp
|
|
skipshortpat []*regexp.Regexp
|
|
|
|
|
+ whitelistpat *regexp.Regexp
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
type testConfig struct {
|
|
type testConfig struct {
|
|
@@ -121,6 +122,10 @@ func (tm *testMatcher) fails(pattern string, reason string) {
|
|
|
tm.failpat = append(tm.failpat, testFailure{regexp.MustCompile(pattern), reason})
|
|
tm.failpat = append(tm.failpat, testFailure{regexp.MustCompile(pattern), reason})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func (tm *testMatcher) whitelist(pattern string) {
|
|
|
|
|
+ tm.whitelistpat = regexp.MustCompile(pattern)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// config defines chain config for tests matching the pattern.
|
|
// config defines chain config for tests matching the pattern.
|
|
|
func (tm *testMatcher) config(pattern string, cfg params.ChainConfig) {
|
|
func (tm *testMatcher) config(pattern string, cfg params.ChainConfig) {
|
|
|
tm.configpat = append(tm.configpat, testConfig{regexp.MustCompile(pattern), cfg})
|
|
tm.configpat = append(tm.configpat, testConfig{regexp.MustCompile(pattern), cfg})
|
|
@@ -208,6 +213,11 @@ func (tm *testMatcher) runTestFile(t *testing.T, path, name string, runTest inte
|
|
|
if r, _ := tm.findSkip(name); r != "" {
|
|
if r, _ := tm.findSkip(name); r != "" {
|
|
|
t.Skip(r)
|
|
t.Skip(r)
|
|
|
}
|
|
}
|
|
|
|
|
+ if tm.whitelistpat != nil {
|
|
|
|
|
+ if !tm.whitelistpat.MatchString(name) {
|
|
|
|
|
+ t.Skip("Skipped by whitelist")
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
t.Parallel()
|
|
t.Parallel()
|
|
|
|
|
|
|
|
// Load the file as map[string]<testType>.
|
|
// Load the file as map[string]<testType>.
|