forked from gucumber/gucumber
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_main.go
44 lines (35 loc) · 799 Bytes
/
run_main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package gucumber
import (
"flag"
"fmt"
)
type filters []string
func (f *filters) String() string {
return fmt.Sprint(*f)
}
func (f *filters) Set(value string) error {
*f = append(*f, value)
return nil
}
var filterFlag filters
var goBuildTags string
func init() {
flag.Var(&filterFlag, "tags", "comma-separated list of tags to filter scenarios by")
flag.StringVar(&goBuildTags, "go-tags", "", "space separated list of tags, wrap in quotes to specify multiple tags")
}
func RunMain() {
flag.Parse()
var dir string
if flag.NArg() == 0 {
dir = "internal/features"
} else {
dir = flag.Arg(0)
}
filt := []string{}
for _, f := range filterFlag {
filt = append(filt, string(f))
}
if err := BuildAndRunDirWithGoBuildTags(dir, filt, goBuildTags); err != nil {
panic(err)
}
}