File: run_main.go

package info (click to toggle)
golang-github-gucumber-gucumber 0.0~git20160715.0.71608e2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 172 kB
  • ctags: 160
  • sloc: makefile: 10
file content (44 lines) | stat: -rw-r--r-- 799 bytes parent folder | download
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 seperated 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)
	}
}