Send #countTests instead of #testCount
authormawalch
Wed, 07 Mar 2018 23:14:09 +0100
changeset 514f50803f4bb59
parent 513 9d572c1caefa
child 515 06436c1b24f6
Send #countTests instead of #testCount
reports/Builder__TestReportFormat.st
     1.1 --- a/reports/Builder__TestReportFormat.st	Wed Oct 18 11:32:14 2017 +0200
     1.2 +++ b/reports/Builder__TestReportFormat.st	Wed Mar 07 23:14:09 2018 +0100
     1.3 @@ -63,7 +63,7 @@
     1.4  
     1.5      | stacktrace |
     1.6      exception isNil ifTrue:[
     1.7 -        stacktrace := nil.        
     1.8 +        stacktrace := nil.
     1.9      ] ifFalse:[
    1.10          stacktrace :=
    1.11              (String streamContents:[:s|
    1.12 @@ -71,7 +71,7 @@
    1.13              ])
    1.14      ].
    1.15  
    1.16 -    ^self writeTestCase: testcase outcome: outcome time: time exception: exception 
    1.17 +    ^self writeTestCase: testcase outcome: outcome time: time exception: exception
    1.18               stacktrace: stacktrace
    1.19  
    1.20      "Created: / 03-08-2011 / 19:44:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.21 @@ -109,7 +109,7 @@
    1.22      ].
    1.23      s nextPutAll:'vars: '; cr.
    1.24      context vars keysAndValuesDo:[:idx :eachVar |
    1.25 -        s nextPutAll:'  '. idx printOn: s. s nextPutAll:': '. 
    1.26 +        s nextPutAll:'  '. idx printOn: s. s nextPutAll:': '.
    1.27          eachVar isString ifTrue:[
    1.28              eachVar storeOn: s.
    1.29          ] ifFalse:[
    1.30 @@ -117,7 +117,7 @@
    1.31          ].
    1.32          s cr.
    1.33      ].
    1.34 -    s nextPutAll:'source: '; cr.    
    1.35 +    s nextPutAll:'source: '; cr.
    1.36  
    1.37      [
    1.38      home := context methodHome.
    1.39 @@ -132,7 +132,7 @@
    1.40          ^ self.
    1.41      ].
    1.42      ] on: Error do:[:ex|
    1.43 -        s 
    1.44 +        s
    1.45              nextPutAll: '** error when getting source: ';
    1.46              nextPutAll:  ex description;
    1.47              nextPutAll: '**';
    1.48 @@ -245,7 +245,7 @@
    1.49          nextPutAll:'<testsuite name="';
    1.50          nextPutAll:(Report encode:report name);
    1.51          nextPutAll:'" tests="';
    1.52 -        print:report suite testCount;
    1.53 +        print:report suite countTests;
    1.54          nextPutAll:('" hostname="%1"' bindWith:OperatingSystem getHostName);
    1.55          nextPutAll:'>'.
    1.56       "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."
    1.57 @@ -266,7 +266,7 @@
    1.58  "/    stream
    1.59  "/        nextPutLine:('    <property name="smalltalk.libbasic.version" value="%1" />'bindWith:stx_libbasic versionString).
    1.60      stream
    1.61 -        nextPutLine: '  </properties>'.       
    1.62 +        nextPutLine: '  </properties>'.
    1.63  
    1.64      startTime := OperatingSystem getMillisecondTime.
    1.65  
    1.66 @@ -356,10 +356,10 @@
    1.67  writeCDATA: string
    1.68      | start stop |
    1.69  
    1.70 -    start := 1. 
    1.71 +    start := 1.
    1.72      stop := start.
    1.73      [ (stop := (string indexOf: $] startingAt: stop)) ~~ 0 ] whileTrue:[
    1.74 -        ((stop < (string size - 1)) 
    1.75 +        ((stop < (string size - 1))
    1.76              and:[(string at: stop + 1) == $]
    1.77                  and:[(string at: stop + 2) == $>]]) ifTrue:[
    1.78                      " Okay, found CDATA end token "
    1.79 @@ -371,12 +371,12 @@
    1.80                  ].
    1.81      ].
    1.82      start < string size ifTrue:[
    1.83 -        stream nextPutAll: string startingAt: start to: string size.        
    1.84 +        stream nextPutAll: string startingAt: start to: string size.
    1.85      ].
    1.86  
    1.87      "
    1.88      String streamContents:[:s | Builder::TestReportFormat::JUnit new report: nil stream: s; writeCDATA:'ABCD']
    1.89 -    String streamContents:[:s | Builder::TestReportFormat::JUnit new report: nil stream: s; writeCDATA:']]]]']         
    1.90 +    String streamContents:[:s | Builder::TestReportFormat::JUnit new report: nil stream: s; writeCDATA:']]]]']
    1.91      String streamContents:[:s | Builder::TestReportFormat::JUnit new report: nil stream: s; writeCDATA:'Some <[CDATA[ CDATA ]]> Some Text and stray terminator ]]> here']
    1.92      "
    1.93  
    1.94 @@ -437,17 +437,17 @@
    1.95      <test
    1.96          name='test_format_link_not_in_repos_with_line'
    1.97          executed='exec-status'
    1.98 -      <result>  
    1.99 +      <result>
   1.100          <success passed='result-status' state='result-state'/>
   1.101          <errorlog><!![CDATA[EXEMPLE OF ERROR LOG]]></errorlog>
   1.102 -      </result>  
   1.103 -    </test>  
   1.104 +      </result>
   1.105 +    </test>
   1.106      "
   1.107  
   1.108 -    |testClassName executionTime testName testDescription 
   1.109 +    |testClassName executionTime testName testDescription
   1.110       successPassed successState exceptionInfo
   1.111 -     compilerName compilerVersion compilerConfiguration compilerVersionDate 
   1.112 -     timeUnit timeMeasure 
   1.113 +     compilerName compilerVersion compilerConfiguration compilerVersionDate
   1.114 +     timeUnit timeMeasure
   1.115       sysInfo osType osVersion cpuType|
   1.116  
   1.117      testClassName := testcase printString.
   1.118 @@ -491,19 +491,19 @@
   1.119          nextPutLine:('    <processor arch="%1">' bindWith:cpuType);
   1.120          "/ nextPutLine:('      <frequency> unit="Mhz" cpufreq="%1" />' bindWith:cpuSpeed);
   1.121          nextPutLine:'    </processor>';
   1.122 -        nextPutLine:('    <compiler name="%1" version="%2" versiondate="%3" configuration="%4" />' 
   1.123 -                            bindWith:compilerName with:compilerVersion 
   1.124 +        nextPutLine:('    <compiler name="%1" version="%2" versiondate="%3" configuration="%4" />'
   1.125 +                            bindWith:compilerName with:compilerVersion
   1.126                              with:compilerVersionDate with:compilerConfiguration);
   1.127          "/ nextPutLine:'    <environment />';
   1.128          nextPutLine:'  </platform>';
   1.129          nextPutLine:'  <result>';
   1.130 -        nextPutLine:('    <success passed="%1" state="100" />' 
   1.131 +        nextPutLine:('    <success passed="%1" state="100" />'
   1.132                              bindWith:successPassed with:successState);
   1.133          "/ cg: in the perfPublisher documentation, I found "mesure".
   1.134          "/ I am not sure, if that was a typo, or is actually what is expected...
   1.135          "/ to be on the save side, I generate both a mesure and a measure attribute,
   1.136          "/ so it will work, even if they ever fix perfPublisher's xml parser.
   1.137 -        nextPutLine:('    <executiontime unit="%1" mesure="%2" measure="%2" isRelevant="yes" />' 
   1.138 +        nextPutLine:('    <executiontime unit="%1" mesure="%2" measure="%2" isRelevant="yes" />'
   1.139                              bindWith:timeUnit with:timeMeasure).
   1.140  
   1.141      exceptionInfo notNil ifTrue:[
   1.142 @@ -571,26 +571,26 @@
   1.143  
   1.144      testClassName := testcase class printString.
   1.145  
   1.146 -    outcome result == TestResult statePass ifTrue:[ 
   1.147 +    outcome result == TestResult statePass ifTrue:[
   1.148          result := #success.
   1.149 -    ] ifFalse:[ 
   1.150 -        outcome result == TestResult stateFail ifTrue:[ 
   1.151 +    ] ifFalse:[
   1.152 +        outcome result == TestResult stateFail ifTrue:[
   1.153              result := #failure.
   1.154 -        ] ifFalse:[ 
   1.155 -            outcome result == TestResult stateError ifTrue:[ 
   1.156 +        ] ifFalse:[
   1.157 +            outcome result == TestResult stateError ifTrue:[
   1.158                  result := #error.
   1.159 -            ] ifFalse:[ 
   1.160 -                outcome result == TestResult stateSkip ifTrue:[ 
   1.161 +            ] ifFalse:[
   1.162 +                outcome result == TestResult stateSkip ifTrue:[
   1.163                      result := #skip.
   1.164                  ] ifFalse:[
   1.165                      self error: 'Invalid test result'.
   1.166                  ]
   1.167              ].
   1.168          ].
   1.169 -    ].    
   1.170 +    ].
   1.171  
   1.172      stream
   1.173 -        nextPutAll:'<test duration="'; nextPutAll:time; nextPutLine:'"'; 
   1.174 +        nextPutAll:'<test duration="'; nextPutAll:time; nextPutLine:'"';
   1.175          tab; nextPutAll:'status="'; nextPutAll: result; nextPutLine:'"';
   1.176          tab; nextPutAll:'ficture="'; nextPutAll: testClassName; nextPutLine:'"';
   1.177          tab; nextPutAll:'name="'; nextPutAll: testcase selector; nextPutLine:'"';
   1.178 @@ -645,7 +645,7 @@
   1.179  
   1.180  writeHeader
   1.181  
   1.182 -    stream nextPutAll: '1..'; nextPutAll: report suite testCount printString; cr.
   1.183 +    stream nextPutAll: '1..'; nextPutAll: report suite countTests printString; cr.
   1.184      index := 0
   1.185  
   1.186      "Modified: / 04-08-2011 / 13:49:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   1.187 @@ -656,23 +656,23 @@
   1.188      | result testDescription statusString |
   1.189  
   1.190      index := index + 1.
   1.191 -    outcome result == TestResult statePass ifTrue:[ 
   1.192 +    outcome result == TestResult statePass ifTrue:[
   1.193          result := #pass.
   1.194 -    ] ifFalse:[ 
   1.195 -        outcome result == TestResult stateFail ifTrue:[ 
   1.196 +    ] ifFalse:[
   1.197 +        outcome result == TestResult stateFail ifTrue:[
   1.198              result := #failure.
   1.199 -        ] ifFalse:[ 
   1.200 -            outcome result == TestResult stateError ifTrue:[ 
   1.201 +        ] ifFalse:[
   1.202 +            outcome result == TestResult stateError ifTrue:[
   1.203                  result := #error.
   1.204 -            ] ifFalse:[ 
   1.205 -                outcome result == TestResult stateSkip ifTrue:[ 
   1.206 +            ] ifFalse:[
   1.207 +                outcome result == TestResult stateSkip ifTrue:[
   1.208                      result := #skip.
   1.209                  ] ifFalse:[
   1.210                      self error: 'Invalid test result'.
   1.211                  ]
   1.212              ].
   1.213          ].
   1.214 -    ].    
   1.215 +    ].
   1.216  
   1.217      testDescription := '%1-%2 (%3ms)'
   1.218                              bindWith:testcase printString