From 11bc6d69caf851bd2ff7b5e0c493494143bb206c Mon Sep 17 00:00:00 2001 From: Joel Stemmer Date: Mon, 22 Dec 2014 12:09:35 +0100 Subject: [PATCH] Add test for skipped testcases --- go-junit-report_test.go | 28 ++++++++++++++++++++++++++++ tests/03-report.xml | 10 ++++++++++ tests/03-skip.txt | 7 +++++++ 3 files changed, 45 insertions(+) create mode 100644 tests/03-report.xml create mode 100644 tests/03-skip.txt diff --git a/go-junit-report_test.go b/go-junit-report_test.go index 92687f4..471e833 100644 --- a/go-junit-report_test.go +++ b/go-junit-report_test.go @@ -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) { diff --git a/tests/03-report.xml b/tests/03-report.xml new file mode 100644 index 0000000..71f287d --- /dev/null +++ b/tests/03-report.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/tests/03-skip.txt b/tests/03-skip.txt new file mode 100644 index 0000000..155938a --- /dev/null +++ b/tests/03-skip.txt @@ -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