File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 99
1010var Homeserver string
1111
12- // Skip the test (via t.Skipf) if the homeserver being tested matches `hs` , else return.
12+ // Skip the test (via t.Skipf) if the homeserver being tested matches one of the homeservers , else return.
1313//
1414// The homeserver being tested is detected via the presence of a `*_blacklist` tag e.g:
1515// go test -tags="dendrite_blacklist"
@@ -18,17 +18,20 @@ var Homeserver string
1818// implementation is added, a respective `hs_$name.go` needs to be created in this directory. This
1919// file pairs together the tag name with a string constant declared in this package
2020// e.g. dendrite_blacklist == runtime.Dendrite
21- func SkipIf (t * testing.T , hs string ) {
21+ func SkipIf (t * testing.T , hses ... string ) {
2222 t .Helper ()
23- if Homeserver == hs {
24- t .Skipf ("skipped on %s" , hs )
23+ for _ , hs := range hses {
24+ if Homeserver == hs {
25+ t .Skipf ("skipped on %s" , hs )
26+ return
27+ }
2528 }
2629 if Homeserver == "" {
2730 // they ran Complement without a blacklist so it's impossible to know what HS they are
2831 // running, warn them.
2932 t .Logf (
30- "WARNING: %s called runtime.SkipIf(%s ) but Complement doesn't know which HS is running as it was run without a *_blacklist tag: executing test." ,
31- t .Name (), hs ,
33+ "WARNING: %s called runtime.SkipIf(%v ) but Complement doesn't know which HS is running as it was run without a *_blacklist tag: executing test." ,
34+ t .Name (), hses ,
3235 )
3336 }
3437}
You can’t perform that action at this time.
0 commit comments