s/BenchmarkReport.st
changeset 29 00d2eaa41853
parent 12 3a7ebd3da52f
child 122 9ad7296fc59a
--- a/s/BenchmarkReport.st	Tue Jun 11 22:54:56 2013 +0100
+++ b/s/BenchmarkReport.st	Wed Jun 12 14:27:14 2013 +0100
@@ -10,6 +10,12 @@
 
 !BenchmarkReport class methodsFor:'instance creation'!
 
+json
+    ^BenchmarkReportJSON new
+
+    "Created: / 12-06-2013 / 14:13:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 text
     ^BenchmarkReportText new
 
@@ -46,9 +52,13 @@
 !BenchmarkReport methodsFor:'writing'!
 
 write
-    ^self subclassResponsibility.
+    self 
+        writeHeader;
+        writeOutcomes;
+        writeFooter.
 
     "Created: / 28-05-2013 / 00:34:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 11-06-2013 / 23:26:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 write: aBenchmarkResult on: aStream
@@ -57,6 +67,30 @@
     self write.
 
     "Created: / 28-05-2013 / 00:33:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+writeFooter
+    self subclassResponsibility
+
+    "Created: / 11-06-2013 / 23:26:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+writeHeader
+    self subclassResponsibility
+
+    "Created: / 11-06-2013 / 23:26:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+writeOutcome:arg
+    "raise an error: must be redefined in concrete subclass(es)"
+
+    ^ self subclassResponsibility
+!
+
+writeOutcomes
+    result outcomesDo:[:outcome | self writeOutcome: outcome ].
+
+    "Created: / 11-06-2013 / 23:26:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !BenchmarkReport class methodsFor:'documentation'!