Add test for skipped testcases

This commit is contained in:
Joel Stemmer 2014-12-22 12:09:35 +01:00
parent c4d99d755b
commit 11bc6d69ca
3 changed files with 45 additions and 0 deletions

View File

@ -74,6 +74,34 @@ var testCases []TestCase = []TestCase{
},
},
},
{
name: "03-skip.txt",
reportName: "03-report.xml",
report: &Report{
Packages: []Package{
{
Name: "package/name",
Time: 150,
Tests: []Test{
{
Name: "TestOne",
Time: 20,
Result: SKIP,
Output: []string{
"file_test.go:11: Skip message",
},
},
{
Name: "TestTwo",
Time: 130,
Result: PASS,
Output: []string{},
},
},
},
},
},
},
}
func TestParser(t *testing.T) {

10
tests/03-report.xml Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuite tests="2" failures="0" time="0.150" name="package/name">
<properties>
<property name="go.version" value="1.0"></property>
</properties>
<testcase classname="name" name="TestOne" time="0.020">
<skipped message="file_test.go:11: Skip message"></skipped>
</testcase>
<testcase classname="name" name="TestTwo" time="0.130"></testcase>
</testsuite>

7
tests/03-skip.txt Normal file
View File

@ -0,0 +1,7 @@
=== RUN TestOne
--- SKIP: TestOne (0.02 seconds)
file_test.go:11: Skip message
=== RUN TestTwo
--- PASS: TestTwo (0.13 seconds)
PASS
ok package/name 0.150s