Send #countTests instead of #testCount
authormawalch
Wed, 07 Mar 2018 23:14:09 +0100
changeset 513 f50803f4bb59
parent 512 9d572c1caefa
child 514 06436c1b24f6
Send #countTests instead of #testCount
reports/Builder__TestReportFormat.st
--- a/reports/Builder__TestReportFormat.st	Wed Oct 18 11:32:14 2017 +0200
+++ b/reports/Builder__TestReportFormat.st	Wed Mar 07 23:14:09 2018 +0100
@@ -63,7 +63,7 @@
 
     | stacktrace |
     exception isNil ifTrue:[
-        stacktrace := nil.        
+        stacktrace := nil.
     ] ifFalse:[
         stacktrace :=
             (String streamContents:[:s|
@@ -71,7 +71,7 @@
             ])
     ].
 
-    ^self writeTestCase: testcase outcome: outcome time: time exception: exception 
+    ^self writeTestCase: testcase outcome: outcome time: time exception: exception
              stacktrace: stacktrace
 
     "Created: / 03-08-2011 / 19:44:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -109,7 +109,7 @@
     ].
     s nextPutAll:'vars: '; cr.
     context vars keysAndValuesDo:[:idx :eachVar |
-        s nextPutAll:'  '. idx printOn: s. s nextPutAll:': '. 
+        s nextPutAll:'  '. idx printOn: s. s nextPutAll:': '.
         eachVar isString ifTrue:[
             eachVar storeOn: s.
         ] ifFalse:[
@@ -117,7 +117,7 @@
         ].
         s cr.
     ].
-    s nextPutAll:'source: '; cr.    
+    s nextPutAll:'source: '; cr.
 
     [
     home := context methodHome.
@@ -132,7 +132,7 @@
         ^ self.
     ].
     ] on: Error do:[:ex|
-        s 
+        s
             nextPutAll: '** error when getting source: ';
             nextPutAll:  ex description;
             nextPutAll: '**';
@@ -245,7 +245,7 @@
         nextPutAll:'<testsuite name="';
         nextPutAll:(Report encode:report name);
         nextPutAll:'" tests="';
-        print:report suite testCount;
+        print:report suite countTests;
         nextPutAll:('" hostname="%1"' bindWith:OperatingSystem getHostName);
         nextPutAll:'>'.
      "Now this is ugly. We want to update the time and the number of failures and errors, but still at the same time stream a valid XML. So remember this position and add some whitespace, that we can fill later."
@@ -266,7 +266,7 @@
 "/    stream
 "/        nextPutLine:('    <property name="smalltalk.libbasic.version" value="%1" />'bindWith:stx_libbasic versionString).
     stream
-        nextPutLine: '  </properties>'.       
+        nextPutLine: '  </properties>'.
 
     startTime := OperatingSystem getMillisecondTime.
 
@@ -356,10 +356,10 @@
 writeCDATA: string
     | start stop |
 
-    start := 1. 
+    start := 1.
     stop := start.
     [ (stop := (string indexOf: $] startingAt: stop)) ~~ 0 ] whileTrue:[
-        ((stop < (string size - 1)) 
+        ((stop < (string size - 1))
             and:[(string at: stop + 1) == $]
                 and:[(string at: stop + 2) == $>]]) ifTrue:[
                     " Okay, found CDATA end token "
@@ -371,12 +371,12 @@
                 ].
     ].
     start < string size ifTrue:[
-        stream nextPutAll: string startingAt: start to: string size.        
+        stream nextPutAll: string startingAt: start to: string size.
     ].
 
     "
     String streamContents:[:s | Builder::TestReportFormat::JUnit new report: nil stream: s; writeCDATA:'ABCD']
-    String streamContents:[:s | Builder::TestReportFormat::JUnit new report: nil stream: s; writeCDATA:']]]]']         
+    String streamContents:[:s | Builder::TestReportFormat::JUnit new report: nil stream: s; writeCDATA:']]]]']
     String streamContents:[:s | Builder::TestReportFormat::JUnit new report: nil stream: s; writeCDATA:'Some <[CDATA[ CDATA ]]> Some Text and stray terminator ]]> here']
     "
 
@@ -437,17 +437,17 @@
     <test
         name='test_format_link_not_in_repos_with_line'
         executed='exec-status'
-      <result>  
+      <result>
         <success passed='result-status' state='result-state'/>
         <errorlog><!![CDATA[EXEMPLE OF ERROR LOG]]></errorlog>
-      </result>  
-    </test>  
+      </result>
+    </test>
     "
 
-    |testClassName executionTime testName testDescription 
+    |testClassName executionTime testName testDescription
      successPassed successState exceptionInfo
-     compilerName compilerVersion compilerConfiguration compilerVersionDate 
-     timeUnit timeMeasure 
+     compilerName compilerVersion compilerConfiguration compilerVersionDate
+     timeUnit timeMeasure
      sysInfo osType osVersion cpuType|
 
     testClassName := testcase printString.
@@ -491,19 +491,19 @@
         nextPutLine:('    <processor arch="%1">' bindWith:cpuType);
         "/ nextPutLine:('      <frequency> unit="Mhz" cpufreq="%1" />' bindWith:cpuSpeed);
         nextPutLine:'    </processor>';
-        nextPutLine:('    <compiler name="%1" version="%2" versiondate="%3" configuration="%4" />' 
-                            bindWith:compilerName with:compilerVersion 
+        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" />' 
+        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" />' 
+        nextPutLine:('    <executiontime unit="%1" mesure="%2" measure="%2" isRelevant="yes" />'
                             bindWith:timeUnit with:timeMeasure).
 
     exceptionInfo notNil ifTrue:[
@@ -571,26 +571,26 @@
 
     testClassName := testcase class printString.
 
-    outcome result == TestResult statePass ifTrue:[ 
+    outcome result == TestResult statePass ifTrue:[
         result := #success.
-    ] ifFalse:[ 
-        outcome result == TestResult stateFail ifTrue:[ 
+    ] ifFalse:[
+        outcome result == TestResult stateFail ifTrue:[
             result := #failure.
-        ] ifFalse:[ 
-            outcome result == TestResult stateError ifTrue:[ 
+        ] ifFalse:[
+            outcome result == TestResult stateError ifTrue:[
                 result := #error.
-            ] ifFalse:[ 
-                outcome result == TestResult stateSkip ifTrue:[ 
+            ] ifFalse:[
+                outcome result == TestResult stateSkip ifTrue:[
                     result := #skip.
                 ] ifFalse:[
                     self error: 'Invalid test result'.
                 ]
             ].
         ].
-    ].    
+    ].
 
     stream
-        nextPutAll:'<test duration="'; nextPutAll:time; nextPutLine:'"'; 
+        nextPutAll:'<test duration="'; nextPutAll:time; nextPutLine:'"';
         tab; nextPutAll:'status="'; nextPutAll: result; nextPutLine:'"';
         tab; nextPutAll:'ficture="'; nextPutAll: testClassName; nextPutLine:'"';
         tab; nextPutAll:'name="'; nextPutAll: testcase selector; nextPutLine:'"';
@@ -645,7 +645,7 @@
 
 writeHeader
 
-    stream nextPutAll: '1..'; nextPutAll: report suite testCount printString; cr.
+    stream nextPutAll: '1..'; nextPutAll: report suite countTests printString; cr.
     index := 0
 
     "Modified: / 04-08-2011 / 13:49:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -656,23 +656,23 @@
     | result testDescription statusString |
 
     index := index + 1.
-    outcome result == TestResult statePass ifTrue:[ 
+    outcome result == TestResult statePass ifTrue:[
         result := #pass.
-    ] ifFalse:[ 
-        outcome result == TestResult stateFail ifTrue:[ 
+    ] ifFalse:[
+        outcome result == TestResult stateFail ifTrue:[
             result := #failure.
-        ] ifFalse:[ 
-            outcome result == TestResult stateError ifTrue:[ 
+        ] ifFalse:[
+            outcome result == TestResult stateError ifTrue:[
                 result := #error.
-            ] ifFalse:[ 
-                outcome result == TestResult stateSkip ifTrue:[ 
+            ] ifFalse:[
+                outcome result == TestResult stateSkip ifTrue:[
                     result := #skip.
                 ] ifFalse:[
                     self error: 'Invalid test result'.
                 ]
             ].
         ].
-    ].    
+    ].
 
     testDescription := '%1-%2 (%3ms)'
                             bindWith:testcase printString