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

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

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

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

@ -32,16 +32,16 @@ func usage() {
// --- GENERAL ---
fmt.Println(cl("Usage:", yellow))
fmt.Println(s(2) + "godog [options] [<paths>]\n")
fmt.Println(s(2) + "godog [options] [<features>]\n")
// --- ARGUMENTS ---
fmt.Println(cl("Arguments:", yellow))
// --> 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)+"- feature "+cl("(*.feature)", 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("")
// --- OPTIONS ---