Этот коммит содержится в:
gedi 2016-05-25 09:01:42 +03:00
родитель 0820626eee
коммит 70af4fc5a7
2 изменённых файлов: 11 добавлений и 8 удалений

Просмотреть файл

@ -12,6 +12,7 @@ import (
) )
var runnerTemplate = template.Must(template.New("main").Parse(`package {{ .Name }} var runnerTemplate = template.Must(template.New("main").Parse(`package {{ .Name }}
import ( import (
{{ if ne .Name "godog" }}"github.com/DATA-DOG/godog"{{ end }} {{ if ne .Name "godog" }}"github.com/DATA-DOG/godog"{{ end }}
"os" "os"
@ -22,9 +23,7 @@ const GodogSuiteName = "{{ .Name }}"
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
status := {{ if ne .Name "godog" }}godog.{{ end }}Run(func (suite *{{ if ne .Name "godog" }}godog.{{ end }}Suite) { status := {{ if ne .Name "godog" }}godog.{{ end }}Run(func (suite *{{ if ne .Name "godog" }}godog.{{ end }}Suite) {
{{range .Contexts}} {{range .Contexts}}{{ . }}(suite){{end}}
{{ . }}(suite)
{{end}}
}) })
os.Exit(status) os.Exit(status)
}`)) }`))
@ -71,7 +70,11 @@ func buildTestPackage(pkg *build.Package, dir string) error {
return err return err
} }
contexts, err := processPackageTestFiles(dir, pkg.TestGoFiles, pkg.XTestGoFiles) contexts, err := processPackageTestFiles(
dir,
pkg.TestGoFiles,
pkg.XTestGoFiles,
)
if err != nil { if err != nil {
return err return err
} }

Просмотреть файл

@ -32,16 +32,16 @@ func usage() {
// --- GENERAL --- // --- GENERAL ---
fmt.Println(cl("Usage:", yellow)) fmt.Println(cl("Usage:", yellow))
fmt.Println(s(2) + "godog [options] [<paths>]\n") fmt.Println(s(2) + "godog [options] [<features>]\n")
// --- ARGUMENTS --- // --- ARGUMENTS ---
fmt.Println(cl("Arguments:", yellow)) fmt.Println(cl("Arguments:", yellow))
// --> paths // --> paths
fmt.Println(opt("paths", "Optional path(s) to execute. Can be:")) fmt.Println(opt("features", "Optional feature(s) to run. Can be:"))
fmt.Println(opt("", s(4)+"- dir "+cl("(features/)", yellow))) fmt.Println(opt("", s(4)+"- dir "+cl("(features/)", yellow)))
fmt.Println(opt("", s(4)+"- feature "+cl("(*.feature)", yellow))) fmt.Println(opt("", s(4)+"- feature "+cl("(*.feature)", yellow)))
fmt.Println(opt("", s(4)+"- scenario at specific line "+cl("(*.feature:10)", yellow))) fmt.Println(opt("", s(4)+"- scenario at specific line "+cl("(*.feature:10)", yellow)))
fmt.Println(opt("", "If no paths are listed, suite tries "+cl("features", yellow)+" path by default.")) fmt.Println(opt("", "If no feature paths are listed, suite tries "+cl("features", yellow)+" path by default."))
fmt.Println("") fmt.Println("")
// --- OPTIONS --- // --- OPTIONS ---