Log start and end of individual tests. expecco_2_7_0 expecco_2_7_0_49 expecco_2_7_5 expecco_2_7_5a
authorJan Vrany <jan.vrany@fit.cvut.cz>
Wed, 29 Oct 2014 15:11:15 +0100
changeset 2504392c84aaf1c
parent 249 50d2712af1a9
child 251 cb6ebbd8d1c0
Log start and end of individual tests.

This helps to find a part of a log produced by some test. Usefull for debugging.
reports/Builder__TestReport.st
     1.1 --- a/reports/Builder__TestReport.st	Tue Sep 16 20:47:48 2014 +0200
     1.2 +++ b/reports/Builder__TestReport.st	Wed Oct 29 15:11:15 2014 +0100
     1.3 @@ -306,11 +306,12 @@
     1.4      outcome collectedOutput: collector contents. 
     1.5      format writeTestCase: testcase outcome: outcome time: time exception: exception.
     1.6      Transcript show:'...ERROR'.
     1.7 +    Logger trace: 'Finised %1>>%2, result ERROR' with: testcase nameForHDTestReport with: testcase selectorForHDTestReport.
     1.8      self errorOutcomes add:outcome.      
     1.9      nerror := nerror + 1.
    1.10  
    1.11      "Created: / 03-08-2011 / 15:00:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.12 -    "Modified: / 16-09-2014 / 18:55:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.13 +    "Modified: / 29-10-2014 / 14:02:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.14  !
    1.15  
    1.16  addFailure: testcase detail: exception
    1.17 @@ -319,11 +320,12 @@
    1.18      outcome collectedOutput: collector contents. 
    1.19      format writeTestCase: testcase outcome: outcome time: time exception: exception.
    1.20      Transcript show:'...FAILED'.
    1.21 +    Logger trace: 'Finised %1>>%2, result FAILED' with: testcase nameForHDTestReport with: testcase selectorForHDTestReport.
    1.22      self failureOutcomes add: outcome.
    1.23      nfailed := nfailed + 1.
    1.24  
    1.25      "Created: / 03-08-2011 / 15:00:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.26 -    "Modified: / 16-09-2014 / 15:23:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.27 +    "Modified: / 29-10-2014 / 14:01:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.28  !
    1.29  
    1.30  addPass: testcase
    1.31 @@ -331,10 +333,11 @@
    1.32      outcome result: TestResult statePass.
    1.33      format writeTestCase: testcase outcome: outcome time: time exception: nil.
    1.34      Transcript show:'...OK'.
    1.35 +    Logger trace: 'Finised %1>>%2, result PASSED' with: testcase nameForHDTestReport with: testcase selectorForHDTestReport.
    1.36      npassed := npassed + 1.
    1.37  
    1.38      "Created: / 03-08-2011 / 15:19:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.39 -    "Modified: / 06-06-2014 / 09:34:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.40 +    "Modified: / 29-10-2014 / 14:01:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.41  !
    1.42  
    1.43  addSkipped: testcase
    1.44 @@ -344,10 +347,11 @@
    1.45      outcome result: TestResult stateSkip.
    1.46      format writeTestCase: testcase outcome: outcome time: time exception: nil.
    1.47      Transcript show:'...SKIPPED'.
    1.48 +    Logger trace: 'Finised %1>>%2, result SKIPPED' with: testcase nameForHDTestReport with: testcase selectorForHDTestReport.
    1.49      nskipped := nskipped + 1.
    1.50  
    1.51      "Created: / 21-11-2012 / 15:35:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.52 -    "Modified: / 16-09-2014 / 19:47:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.53 +    "Modified: / 29-10-2014 / 14:01:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.54  ! !
    1.55  
    1.56  !TestReport::Result methodsFor:'initialization'!
    1.57 @@ -423,8 +427,7 @@
    1.58          sel := '...' , (sel copyFrom: sel size - 16 to: sel size)
    1.59      ].
    1.60      Transcript showCR:('%1 >> #%2' bindWith: aTestCase nameForHDTestReport with: aTestCase selectorForHDTestReport).
    1.61 -    Transcript show:('%-20s >> %-20s : ' printfWith: nm with: sel). 
    1.62 -
    1.63 +    Transcript show:('%-20s >> %-20s : ' printfWith: nm with: sel).
    1.64  
    1.65      outcome := self createOutcome.
    1.66      outcome testCase: aTestCase.
    1.67 @@ -449,7 +452,7 @@
    1.68      self error:'Unssuported platform'
    1.69  
    1.70      "Created: / 12-01-2012 / 17:52:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.71 -    "Modified: / 28-11-2012 / 18:04:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.72 +    "Modified: / 29-10-2014 / 13:57:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.73  ! !
    1.74  
    1.75  !TestReport::Result methodsFor:'running-private'!
    1.76 @@ -457,6 +460,7 @@
    1.77  lightForkCase:aTestCase debugged: debugged timeout: timeout
    1.78      | thread sema stime etime timeouted error stack log logPos |
    1.79  
    1.80 +    Logger trace: 'Running %1>>%2' with: aTestCase nameForHDTestReport with: aTestCase selectorForHDTestReport.
    1.81      Transcript show:'F'.
    1.82      sema := Semaphore new.
    1.83      stime := OperatingSystem getMillisecondTime.
    1.84 @@ -486,14 +490,15 @@
    1.85                       time: etime - stime
    1.86                  exception: error
    1.87                 stacktrace: stack.
    1.88 -         Transcript show:'...ERROR'
    1.89 +         Transcript show:'...ERROR'.
    1.90 +         Logger trace: 'Finised %1>>%2, result ERROR (timeout)' with: aTestCase nameForHDTestReport with: aTestCase selectorForHDTestReport.
    1.91      ].
    1.92  
    1.93      outcome := nil.
    1.94      Transcript cr.
    1.95  
    1.96      "Created: / 12-01-2012 / 17:42:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.97 -    "Modified: / 06-06-2014 / 09:33:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.98 +    "Modified: / 29-10-2014 / 13:59:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    1.99  !
   1.100  
   1.101  unixForkCase:aTestCase debugged: debugged timeout: timeout