Merge pull request #6 from ikarishinjieva/feature/fix_go_1_4_support

fix go 1.4 support
This commit is contained in:
Joël Stemmer 2014-12-22 13:45:55 +01:00
commit 6982e7a3a3
4 changed files with 41 additions and 1 deletions

View File

@ -102,6 +102,32 @@ var testCases []TestCase = []TestCase{
},
},
},
{
name: "04-go_1_4.txt",
reportName: "04-report.xml",
report: &Report{
Packages: []Package{
{
Name: "package/name",
Time: 160,
Tests: []Test{
{
Name: "TestOne",
Time: 60,
Result: PASS,
Output: []string{},
},
{
Name: "TestTwo",
Time: 100,
Result: PASS,
Output: []string{},
},
},
},
},
},
},
}
func TestParser(t *testing.T) {

View File

@ -34,7 +34,7 @@ type Test struct {
}
var (
regexStatus = regexp.MustCompile(`^--- (PASS|FAIL|SKIP): (.+) \((\d+\.\d+) seconds\)$`)
regexStatus = regexp.MustCompile(`^--- (PASS|FAIL|SKIP): (.+) \((\d+\.\d+)(?: seconds|s)\)$`)
regexResult = regexp.MustCompile(`^(ok|FAIL)\s+(.+)\s(\d+\.\d+)s$`)
)

6
tests/04-go_1_4.txt Normal file
View File

@ -0,0 +1,6 @@
=== RUN TestOne
--- PASS: TestOne (0.06s)
=== RUN TestTwo
--- PASS: TestTwo (0.10s)
PASS
ok package/name 0.160s

8
tests/04-report.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite tests="2" failures="0" time="0.160" name="package/name">
<properties>
<property name="go.version" value="1.0"></property>
</properties>
<testcase classname="name" name="TestOne" time="0.060"></testcase>
<testcase classname="name" name="TestTwo" time="0.100"></testcase>
</testsuite>