reports/Builder__TestReportFormat.st
changeset 104 7b1b26108f1f
parent 91 971a6aa7f424
child 191 cc00c3e2019c
--- a/reports/Builder__TestReportFormat.st	Tue Nov 13 11:33:02 2012 +0100
+++ b/reports/Builder__TestReportFormat.st	Wed Nov 21 16:39:31 2012 +0100
@@ -10,7 +10,7 @@
 !
 
 TestReportFormat subclass:#JUnit
-	instanceVariableNames:'position failures errors startTime stopTime'
+	instanceVariableNames:'position failures errors skipped startTime stopTime'
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:TestReportFormat
@@ -200,8 +200,10 @@
     super initialize.
     errors := 0.
     failures := 0.
+    skipped := 0.
 
     "Created: / 03-08-2011 / 15:26:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 21-11-2012 / 15:33:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TestReportFormat::JUnit methodsFor:'writing'!
@@ -223,12 +225,15 @@
         print:failures;
         nextPutAll:'" errors="';
         print:errors;
+        nextPutAll:'" skipped="';
+        print:skipped;
         nextPutAll:'" time="';
         print:(Time milliseconds:stopTime since:startTime) / 1000.0;
         nextPutAll:'">'.
     stream close.
 
     "Created: / 03-08-2011 / 14:22:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 21-11-2012 / 15:34:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 writeHeader
@@ -255,6 +260,7 @@
 
     outcome == #failure ifTrue:[failures := failures + 1].
     outcome == #error ifTrue:[errors := errors + 1].
+    outcome == #skip ifTrue:[skipped := skipped + 1].
 
     stream tab; 
             nextPutAll: '<testcase classname="'; 
@@ -263,31 +269,36 @@
             nextPutAll: (self encode: testcase selectorForHDTestReport); 
             nextPutAll: '" time="'; print: (time ? 0) / 1000.0; nextPutAll: '">'; cr.
 
-    outcome ~~ #pass ifTrue:[
-        | type message |
+    outcome == #skip ifTrue:[
+        stream tab; tab; nextPutAll: '<skipped/>'.
+    ] ifFalse:[
+        outcome ~~ #pass ifTrue:[
+            | type message |
 
-        exception isNil ifTrue:[
-            type := 'unknown exception'.
-            message := 'unknown exception occured (no exception details available)'
-        ] ifFalse:[
-            type := exception class name.
-            message := exception messageText ifNil:[ exception description ].
-        ].
-        
+            exception isNil ifTrue:[
+                type := 'unknown exception'.
+                message := 'unknown exception occured (no exception details available)'
+            ] ifFalse:[
+                type := exception class name.
+                message := exception messageText ifNil:[ exception description ].
+            ].
+            
 
-        stream tab; tab;
-            nextPut:$<; nextPutAll: outcome;
-            nextPutAll:' type="';
-            nextPutAll:(self encode:type);
-            nextPutAll:'" message="';
-            nextPutAll:(self encode: message);
-            nextPutAll:'"><!![CDATA['; cr.
-        stream
-            nextPutAll:(stacktrace ? 'stacktrace not available').
-        stream
-            nextPutAll:']]></'; nextPutAll: outcome; nextPutAll:'>';
-            nextPut:Character lf
+            stream tab; tab;
+                nextPut:$<; nextPutAll: outcome;
+                nextPutAll:' type="';
+                nextPutAll:(self encode:type);
+                nextPutAll:'" message="';
+                nextPutAll:(self encode: message);
+                nextPutAll:'"><!![CDATA['; cr.
+            stream
+                nextPutAll:(stacktrace ? 'stacktrace not available').
+            stream
+                nextPutAll:']]></'; nextPutAll: outcome; nextPutAll:'>';
+                nextPut:Character lf
+        ].
     ].
+
     stream tab; 
             nextPutAll: '</testcase>'; cr.
 
@@ -295,6 +306,7 @@
     stream flush
 
     "Created: / 03-08-2011 / 19:42:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 21-11-2012 / 15:35:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TestReportFormat::PerfPublisher class methodsFor:'accessing'!