s/BenchmarkRunnerResult.st
changeset 99 c7755eb4166c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/s/BenchmarkRunnerResult.st	Mon Jun 24 09:18:40 2013 +0100
@@ -0,0 +1,112 @@
+"{ Package: 'jv:calipel/s' }"
+
+BenchmarkResult subclass:#BenchmarkRunnerResult
+	instanceVariableNames:'transcript'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'CalipeL-S-Core-Runner'
+!
+
+!BenchmarkRunnerResult class methodsFor:'documentation'!
+
+documentation
+" 
+ 
+  Replace 'Object', 'NewClass1' and
+  the empty string arguments by true values.
+ 
+  Install (or change) the class by 'accepting',
+  either via the menu or the keyboard (usually CMD-A).
+ 
+  You can also change the category simply by editing
+  the categoryString and accepting.
+ 
+  To be nice to others (and yourself later), do not forget to
+  add some documentation; preferably under the classes documentation
+  protocol.
+  (see the `create documentation stubs' item in the methodList menu;
+   switch from instance to class to find this menu item.)
+ 
+  Notice, that ST/X uses the convention to document the class using
+  comment-only class methods (however, ST80 comments are supported and
+  can be changed via the class-documentation menu).
+ 
+ 
+ 
+  Notice: 
+    the above text has been extracted from the classes documentation method.
+    Any change in it will be lost if you 'accept' here.
+    To change the documentation, switch to the documentation method and 'accept' any changes there.
+ 
+"
+! !
+
+!BenchmarkRunnerResult methodsFor:'initialization'!
+
+initialize
+    "Invoked when a new instance is created."
+
+    super initialize.
+    transcript := BenchmarkPlatform current stderr.
+    (Smalltalk isSmalltalkX and:[Transcript isView]) ifTrue:[
+        transcript := Transcript
+    ].
+
+    "Created: / 24-06-2013 / 01:16:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!BenchmarkRunnerResult methodsFor:'running-private'!
+
+run:aBenchmarkInstance with: aDictionary
+    | nm |
+
+    nm := aBenchmarkInstance name.
+    transcript next: (25 - nm size) put: Character space.
+    transcript nextPutAll: nm.
+    transcript nextPutAll: '...'.
+
+    super run:aBenchmarkInstance with: aDictionary.
+
+    transcript nextPutAll: 'OK ['.
+    transcript nextPutAll: (outcomes detect:[:o|o benchmark == aBenchmarkInstance ]) time printString.
+    transcript nextPutAll: ']
+'
+
+    "Created: / 24-06-2013 / 01:19:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+setUp: aBenchmarkInstance parameters: aDictionary
+    transcript nextPutAll: 'S..'.
+    super setUp: aBenchmarkInstance parameters: aDictionary
+
+    "Created: / 24-06-2013 / 01:20:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+tearDown: aBenchmarkInstance
+    transcript nextPutAll: 'T..'.
+    super tearDown: aBenchmarkInstance
+
+    "Created: / 24-06-2013 / 01:21:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+timeIt: aBenchmarkInstance
+    transcript nextPutAll: 'B..'.
+    ^super timeIt: aBenchmarkInstance.
+
+    "Created: / 24-06-2013 / 01:22:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+warmUp: aBenchmarkInstance
+    transcript nextPutAll: 'W..'.
+    super warmUp: aBenchmarkInstance.
+
+    "Created: / 24-06-2013 / 01:21:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!BenchmarkRunnerResult class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+