TestResultReporter.st
changeset 734 105a0c767ba1
parent 714 43c6db2bc66a
child 735 cd6ba429d2db
--- a/TestResultReporter.st	Tue Mar 26 18:25:29 2019 +0100
+++ b/TestResultReporter.st	Tue Mar 26 18:39:32 2019 +0100
@@ -591,13 +591,14 @@
         nextPutAll:(' status="%1"' bindWith:testResult);
         nextPutAll:(' time="%1"' bindWith:executionTimeString).
 
-    ((testResult = TestResult statePass) 
+    ((testResult = TestResult statePass or:[testResult = TestResult stateSkip]) 
     and:[ testOutcome collectedOutput isEmptyOrNil ]) ifTrue:[
         stream nextPutAll:'/>'; cr.
     ] ifFalse:[
         stream nextPutAll:'>'; cr.
 
-        testResult = TestResult statePass ifFalse:[
+        (testResult ~= TestResult statePass
+        and:[testResult ~= TestResult stateSkip]) ifTrue:[
             self reportXml_jUnitResultAndTraceback:testOutcome state:testResult.
 
             "/ generate a link to the source file
@@ -624,6 +625,7 @@
     ].
 
     "Created: / 18-08-2011 / 20:30:50 / cg"
+    "Modified: / 26-03-2019 / 18:38:43 / Claus Gittinger"
 ! !
 
 !TestResultReporter methodsFor:'reporting - xml-perfPublisher'!
@@ -698,7 +700,7 @@
     testDescription := '%1-%2' bindWith:testClassName with:testName.
 
     successPassed := (testResult == #success) ifTrue:['yes'] ifFalse:['no'].
-    testResult ~~ #success ifTrue:[
+    (testResult ~~ #success and:[testResult ~~ #skipped]) ifTrue:[
         exceptionInfo := testOutcome exceptionDetail.
     ].
 
@@ -720,44 +722,50 @@
     timeUnit := 'ms'.
     timeMeasure := executionTime.
 
-    stream
-        nextPutLine:('<test name="%1" executed="yes">' bindWith: testName);
-        nextPutLine:('  <description><!![CDATA[%1]]></description>' bindWith: testDescription);
-        nextPutLine:'  <platform>';
-        nextPutLine:'    <os>';
-        nextPutLine:('      <type><!![CDATA[%1]]></type>' bindWith:osType);
-        nextPutLine:('      <version><!![CDATA[%1]]></version>' bindWith:osVersion);
-        nextPutLine:'    </os>';
-        nextPutLine:('    <processor arch="%1" wordLength="%2">' bindWith:cpuType with:(ExternalBytes sizeofPointer * 8));
-        "/ nextPutLine:('      <frequency> unit="Mhz" cpufreq="%1" />' bindWith:cpuSpeed);
-        nextPutLine:'    </processor>';
-        nextPutLine:('    <compiler name="%1" version="%2" versiondate="%3" configuration="%4" />' 
-                            bindWith:compilerName with:compilerVersion 
-                            with:compilerVersionDate with:compilerConfiguration);
-        "/ nextPutLine:'    <environment />';
-        nextPutLine:'  </platform>';
-        nextPutLine:'  <result>';
-        nextPutLine:('    <success passed="%1" state="100" />' 
-                            bindWith:successPassed with:successState);
-        "/ cg: in the perfPublisher documentation, I found "mesure".
-        "/ I am not sure, if that was a typo, or is actually what is expected...
-        "/ to be on the save side, I generate both a mesure and a measure attribute,
-        "/ so it will work, even if they ever fix perfPublisher's xml parser.
-        nextPutLine:('    <executiontime unit="%1" mesure="%2" measure="%2" isRelevant="yes" />' 
-                            bindWith:timeUnit with:timeMeasure).
+    testResult == #skipped ifTrue:[
+        stream
+            nextPutLine:('<test name="%1" executed="no">' bindWith: testName);
+            nextPutLine:('  <description><!![CDATA[%1]]></description>' bindWith: testDescription)
+    ] ifFalse:[    
+        stream
+            nextPutLine:('<test name="%1" executed="yes">' bindWith: testName);
+            nextPutLine:('  <description><!![CDATA[%1]]></description>' bindWith: testDescription);
+            nextPutLine:'  <platform>';
+            nextPutLine:'    <os>';
+            nextPutLine:('      <type><!![CDATA[%1]]></type>' bindWith:osType);
+            nextPutLine:('      <version><!![CDATA[%1]]></version>' bindWith:osVersion);
+            nextPutLine:'    </os>';
+            nextPutLine:('    <processor arch="%1" wordLength="%2">' bindWith:cpuType with:(ExternalBytes sizeofPointer * 8));
+            "/ nextPutLine:('      <frequency> unit="Mhz" cpufreq="%1" />' bindWith:cpuSpeed);
+            nextPutLine:'    </processor>';
+            nextPutLine:('    <compiler name="%1" version="%2" versiondate="%3" configuration="%4" />' 
+                                bindWith:compilerName with:compilerVersion 
+                                with:compilerVersionDate with:compilerConfiguration);
+            "/ nextPutLine:'    <environment />';
+            nextPutLine:'  </platform>';
+            nextPutLine:'  <result>';
+            nextPutLine:('    <success passed="%1" state="100" />' 
+                                bindWith:successPassed with:successState);
+            "/ cg: in the perfPublisher documentation, I found "mesure".
+            "/ I am not sure, if that was a typo, or is actually what is expected...
+            "/ to be on the save side, I generate both a mesure and a measure attribute,
+            "/ so it will work, even if they ever fix perfPublisher's xml parser.
+            nextPutLine:('    <executiontime unit="%1" mesure="%2" measure="%2" isRelevant="yes" />' 
+                                bindWith:timeUnit with:timeMeasure).
 
-    exceptionInfo notNil ifTrue:[
+        exceptionInfo notNil ifTrue:[
+            stream
+                nextPutLine:'    <errorlog><!![CDATA[';
+                nextPutAll:exceptionInfo;
+                nextPutLine:']]></errorlog>'.
+            ].
         stream
-            nextPutLine:'    <errorlog><!![CDATA[';
-            nextPutAll:exceptionInfo;
-            nextPutLine:']]></errorlog>'.
-        ].
-    stream
-        nextPutLine:'  </result>'.
-
+            nextPutLine:'  </result>'.
+    ].
     stream nextPutLine:'</test>'.
 
     "Created: / 30-07-2011 / 12:19:03 / cg"
+    "Modified: / 26-03-2019 / 18:37:30 / Claus Gittinger"
 ! !
 
 !TestResultReporter methodsFor:'reporting - xml-python-unit'!
@@ -778,7 +786,7 @@
         nextPutLine: '<unittest-results>'.
 
     result passedOutcomes  do:[:each|self reportXml_pythonUnitTest: each result: #success].
-    result skippedOutcomes  do:[:each|self reportXml_pythonUnitTest: each result: #error].
+    result skippedOutcomes  do:[:each|self reportXml_pythonUnitTest: each result: #skipped].
     result failureOutcomes do:[:each|self reportXml_pythonUnitTest: each result: #failure].
     result errorOutcomes   do:[:each|self reportXml_pythonUnitTest: each result: #error].
 
@@ -786,6 +794,7 @@
         nextPutLine: '</unittest-results>'
 
     "Created: / 03-08-2011 / 12:56:04 / cg"
+    "Modified: / 26-03-2019 / 18:35:17 / Claus Gittinger"
 !
 
 reportXml_pythonUnitTest:testOutcome result: testResult
@@ -816,11 +825,13 @@
         "It seems that some tools requires the file attributes. So we supply one :-)"
         tab; nextPutAll:'file="'; nextPutAll: testClassName , '.st'; nextPutLine:'">'.
 
-    testResult ~= #success ifTrue:[self reportXml_pythonUnitTraceback: test].
+    (testResult ~= #success
+    and:[testResult ~= #skipped]) ifTrue:[self reportXml_pythonUnitTraceback: test].
 
     stream nextPutLine:'</test>'.
 
     "Created: / 03-08-2011 / 12:56:37 / cg"
+    "Modified: / 26-03-2019 / 18:35:02 / Claus Gittinger"
 !
 
 reportXml_pythonUnitTraceback: test