#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Thu, 28 Mar 2019 13:44:12 +0100
changeset 742 fbe26a85e34a
parent 741 5385d22dcc62
child 743 73d95feec87f
#FEATURE by cg class: TestResult class definition added: #endTime comment/format in: #timestamp #timestamp: changed: #endTime: #executionTime
TestResult.st
--- a/TestResult.st	Thu Mar 28 13:35:53 2019 +0100
+++ b/TestResult.st	Thu Mar 28 13:44:12 2019 +0100
@@ -5,7 +5,8 @@
 "{ NameSpace: Smalltalk }"
 
 Object subclass:#TestResult
-	instanceVariableNames:'name timestamp failures errors passed skipped outcome lastOutcome'
+	instanceVariableNames:'name timestamp failures errors passed skipped outcome lastOutcome
+		endTime'
 	classVariableNames:'DefaultClass'
 	poolDictionaries:''
 	category:'SUnit-Base'
@@ -159,11 +160,21 @@
 		addAll: self failures; yourself
 !
 
+endTime
+    "get the overall (suite) end time;
+     nil if not yet finished"
+
+    ^ endTime
+
+    "Created: / 28-03-2019 / 13:42:31 / Claus Gittinger"
+!
+
 endTime:aTimestamp
     "sets the overall (suite) end time"
 
-    "/ ignored, for now (Neil should add it)
-    "/ endTime := aTimestamp.
+    endTime := aTimestamp.
+
+    "Modified: / 28-03-2019 / 13:42:13 / Claus Gittinger"
 !
 
 errorCount
@@ -206,7 +217,11 @@
     "return the execution time (in seconds). 
      If unknown, or asked before or during a run, return nil"
 
-    ^ nil
+    timestamp isNil ifTrue:[^ nil].
+    endTime isNil ifTrue:[^ nil].  
+    ^ endTime secondDeltaFrom:timestamp
+
+    "Modified: / 28-03-2019 / 13:43:57 / Claus Gittinger"
 !
 
 failureCount
@@ -351,11 +366,19 @@
 !
 
 timestamp
+    "get the start time"
+
     ^ timestamp
+
+    "Modified (comment): / 28-03-2019 / 13:41:53 / Claus Gittinger"
 !
 
 timestamp:aTimestamp
+    "sets the start time"
+    
     timestamp := aTimestamp.
+
+    "Modified (comment): / 28-03-2019 / 13:41:47 / Claus Gittinger"
 ! !
 
 !TestResult methodsFor:'adding / removing'!