s/BenchmarkReport.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 25 Sep 2015 05:18:26 +0100
changeset 285 0cf54ee76de5
parent 192 a0209af616e7
permissions -rw-r--r--
Normalized Windows OS identification string with Pharo

"{ Package: 'jv:calipel/s' }"

"{ NameSpace: Smalltalk }"

Object subclass:#BenchmarkReport
	instanceVariableNames:'stream result name description'
	classVariableNames:''
	poolDictionaries:''
	category:'CalipeL-S-Core-Reports'
!


!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

    "Created: / 28-05-2013 / 00:59:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 28-05-2013 / 11:03:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!BenchmarkReport class methodsFor:'testing'!

isAbstract
    ^self == BenchmarkReport

    "Created: / 28-05-2013 / 00:32:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!BenchmarkReport methodsFor:'accessing'!

description
    ^ description notNil ifTrue:[description] ifFalse:['Default'].

    "Modified: / 19-09-2013 / 22:45:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

description:aString
    description := aString.
!

name
    ^ name notNil ifTrue:[name] ifFalse:['default']

    "Modified: / 19-09-2013 / 23:29:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

name:aString
    name := aString.
!

result
    ^ result
!

result:something
    result := something.
!

stream
    ^ stream
!

stream:something
    stream := something.
! !

!BenchmarkReport methodsFor:'writing'!

write
    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
    self stream: aStream.
    self result: aBenchmarkResult.
    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'!

version_HG

    ^ '$Changeset: <not expanded> $'
!

version_MC
    ^ 'CalipeL_S-Core-JanVrany.7 5c300a20-c9d7-11e2-a959-606720e43e2c 2013-05-31T10:49:17 JanVrany'
! !