class: Builder::TestReport
authorJan Vrany <jan.vrany@fit.cvut.cz>
Thu, 31 Jan 2013 14:56:16 +0100
changeset 111 d0fa0756222b
parent 110 afc834064900
child 112 8df32339b6cd
class: Builder::TestReport changed: #runReport
reports/Builder__TestReport.st
--- a/reports/Builder__TestReport.st	Wed Jan 30 12:19:20 2013 +0100
+++ b/reports/Builder__TestReport.st	Thu Jan 31 14:56:16 2013 +0100
@@ -10,7 +10,7 @@
 !
 
 TestResult subclass:#Result
-	instanceVariableNames:'format time'
+	instanceVariableNames:'format time npassed nfailed nerror nskipped'
 	classVariableNames:''
 	poolDictionaries:''
 	privateIn:TestReport
@@ -146,12 +146,24 @@
     |result|
     result := Result new format:format.
     suite run:result.
+    Transcript cr; cr.
+    Transcript show: 'SUMMARY: '.
+    result printOn: Transcript.
+    Transcript cr.
 
     "Created: / 04-08-2011 / 12:39:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 31-01-2013 / 13:48:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TestReport::Result methodsFor:'accessing'!
 
+errorCount
+
+    ^nerror
+
+    "Created: / 31-01-2013 / 13:54:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 exceptions
 
     ^super exceptions , HaltInterrupt
@@ -159,12 +171,33 @@
     "Created: / 03-08-2011 / 14:59:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+failureCount
+
+    ^nfailed
+
+    "Created: / 31-01-2013 / 13:53:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 format
     ^ format
 !
 
 format:aFormat
     format := aFormat.
+!
+
+passedCount
+
+    ^npassed
+
+    "Created: / 31-01-2013 / 13:54:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+skippedCount
+
+    ^nskipped
+
+    "Created: / 31-01-2013 / 13:54:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TestReport::Result methodsFor:'adding'!
@@ -172,33 +205,51 @@
 addError: testcase detail: exception
 
     format writeTestCase: testcase outcome: #error time: time exception: exception.
-    Transcript show:'ERROR'
+    Transcript show:'ERROR'.
+    nerror := nerror + 1.
 
     "Created: / 03-08-2011 / 15:00:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 31-01-2013 / 13:52:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 addFailure: testcase detail: exception
 
     format writeTestCase: testcase outcome: #failure time: time exception: exception.
-    Transcript show:'FAILED'
+    Transcript show:'FAILED'.
+    nfailed := nfailed + 1.
 
     "Created: / 03-08-2011 / 15:00:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 31-01-2013 / 13:53:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 addPass: testcase
 
     format writeTestCase: testcase outcome: #pass time: time exception: nil.
-    Transcript show:'OK'
+    Transcript show:'OK'.
+    npassed := npassed + 1.
 
     "Created: / 03-08-2011 / 15:19:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 31-01-2013 / 13:53:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 addSkipped: testcase
 
     format writeTestCase: testcase outcome: #skip time: time exception: nil.
-    Transcript show:'SKIPPED'
+    Transcript show:'SKIPPED'.
+    nskipped := nskipped + 1.
 
     "Created: / 21-11-2012 / 15:35:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 31-01-2013 / 13:53:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TestReport::Result methodsFor:'initialization'!
+
+initialize
+    super initialize.
+
+    npassed := nfailed := nerror := nskipped := 0
+
+    "Created: / 31-01-2013 / 13:52:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TestReport::Result methodsFor:'running'!
@@ -419,3 +470,4 @@
 version_SVN
     ^ '§Id: Builder__TestReport.st 300 2012-01-12 17:53:04Z vranyj1 §'
 ! !
+