Add "Test" prefix to backend test functions

This commit is contained in:
Alexander Neumann 2016-01-23 19:12:02 +01:00
parent e4f2e4a203
commit f05a32509e
13 changed files with 94 additions and 94 deletions

View file

@ -39,7 +39,7 @@ var SkipMessage string
{{ range $f := .Funcs }}
func Test{{ $prefix }}{{ $f }}(t *testing.T){
if SkipMessage != "" { t.Skip(SkipMessage) }
test.{{ $f }}(t)
test.Test{{ $f }}(t)
}
{{ end }}
@ -60,7 +60,7 @@ func errx(err error) {
os.Exit(1)
}
var funcRegex = regexp.MustCompile(`^func\s+([A-Z].*)\s*\(`)
var funcRegex = regexp.MustCompile(`^func\s+Test(.+)\s*\(`)
func findTestFunctions() (funcs []string) {
f, err := os.Open(*testFile)