aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/csource_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-08-09 12:57:23 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-08-09 15:41:52 +0200
commit8b78527436f4171d1fbd1c44b1954b7807ec5ef4 (patch)
tree62df7be0fbdad79d8d3889527277a278f2147a7a /pkg/csource/csource_test.go
parent98dd5f9922717291e20498f5b3ee48694a568a0a (diff)
pkg/csource, pkg/repro: filter out invalid options combinations
We currently have 2 invalid options combinations: - collide without threads - procs>1 without repeat They are invalid in the sense that result of csource.Write is the same for them. Filter out these combinations. This cuts csource testing time in half and reduces repro minimization time.
Diffstat (limited to 'pkg/csource/csource_test.go')
-rw-r--r--pkg/csource/csource_test.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/csource/csource_test.go b/pkg/csource/csource_test.go
index dc703d37d..ae34a9499 100644
--- a/pkg/csource/csource_test.go
+++ b/pkg/csource/csource_test.go
@@ -51,7 +51,13 @@ func enumerateField(opt Options, field int) []Options {
} else {
panic(fmt.Sprintf("field '%v' is not boolean", fldName))
}
- return opts
+ var checked []Options
+ for _, opt := range opts {
+ if err := opt.Check(); err == nil {
+ checked = append(checked, opt)
+ }
+ }
+ return checked
}
func allOptionsSingle() []Options {
@@ -102,7 +108,7 @@ func TestOptions(t *testing.T) {
permutations = append(permutations, allPermutations[r.Intn(len(allPermutations))])
}
} else {
- permutations = append(permutations, allPermutations...)
+ permutations = allPermutations
}
for i, opts := range permutations {
t.Run(fmt.Sprintf("%v", i), func(t *testing.T) {