reports/Builder__Report.st
author Claus Gittinger <cg@exept.de>
Thu, 28 Mar 2019 13:54:38 +0100
changeset 542 aa25a71be62a
parent 231 9551cb7cfe38
permissions -rw-r--r--
#DOCUMENTATION by cg class: stx_goodies_builder_quickSelfTest class definition class: stx_goodies_builder_quickSelfTest class added:18 methods
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Package: 'stx:goodies/builder/reports' }"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
"{ NameSpace: Builder }"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
Object subclass:#Report
218
82447e847e2d Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 163
diff changeset
     6
	instanceVariableNames:'name ident packages format'
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	classVariableNames:'Verbose OutputDir'
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
	poolDictionaries:''
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
	category:'Builder-Reports'
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
!Report class methodsFor:'initialization'!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
initialize
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
    Verbose := false.
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
    OutputDir := Filename currentDirectory.
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
    "Created: / 14-03-2011 / 19:42:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
! !
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
!Report class methodsFor:'instance creation'!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
new
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
    "return an initialized instance"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
    ^ self basicNew initialize.
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
! !
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
!Report class methodsFor:'accessing'!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
76
4c992db5503a --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 69
diff changeset
    33
available
4c992db5503a --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 69
diff changeset
    34
    "Return all available reports ready to run. 
4c992db5503a --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 69
diff changeset
    35
     Unfinished/Experimental reports are not returned"
4c992db5503a --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 69
diff changeset
    36
4c992db5503a --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 69
diff changeset
    37
    ^{ 
4c992db5503a --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 69
diff changeset
    38
        Builder::TestReport .
4c992db5503a --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 69
diff changeset
    39
        Builder::LintReport .
4c992db5503a --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 69
diff changeset
    40
    }
4c992db5503a --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 69
diff changeset
    41
4c992db5503a --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 69
diff changeset
    42
    "Created: / 13-01-2012 / 12:01:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c992db5503a --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 69
diff changeset
    43
!
4c992db5503a --help improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 69
diff changeset
    44
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
outputDir
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
    ^OutputDir ? '.'
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
    "
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
        Report outputDir: '/tmp/reports' 
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
    "
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
    "Created: / 07-10-2011 / 09:12:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
outputDir: aStringOrFilename
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
    OutputDir := aStringOrFilename asFilename.
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
    "
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
        Report outputDir: '/tmp/reports' 
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
    "
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
    "Created: / 14-03-2011 / 19:40:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
! !
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
!Report class methodsFor:'private'!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
convert: aString
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
	^ (aString asString 
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
		copyReplaceAll: (String with: Character cr with: Character lf) with: (String with: Character lf))
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
		copyReplaceAll: (String with: Character cr) with: (String with: Character lf)
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    74
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
encode: aString
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
    | in out c |
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
    (aString includesAny: #($< $> $& $")) ifFalse:[^aString].
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
    in := aString readStream.
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
    out := String new writeStream.  
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
    [in atEnd ] whileFalse:[
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
        c := in next.
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    84
        c == $< ifTrue:[out nextPutAll:'&lt;'] ifFalse:[
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
        c == $> ifTrue:[out nextPutAll:'&gt;'] ifFalse:[
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
        c == $& ifTrue:[out nextPutAll:'&amp;'] ifFalse:[
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    87
        c == $" ifTrue:[out nextPutAll:'&quot;'] ifFalse:[
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
        out nextPut: c]]]]].
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    89
    ^out contents.
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    90
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    91
    "
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    92
        HDReport basicNew encode: 'abx' 
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
        HDReport basicNew encode: ''  
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    94
        HDReport basicNew encode: 'sss <clint>()'       
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95
    "
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    96
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
    "Modified: / 11-03-2011 / 17:12:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
encodeFilename: aString
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   101
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   102
    ^(aString copyReplaceAll: $: with:$_) copyReplaceAll: $/ with:$_
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   103
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   104
    "Created: / 14-03-2011 / 14:14:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   105
    "Modified: / 14-03-2011 / 23:45:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   106
! !
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   107
231
9551cb7cfe38 Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 218
diff changeset
   108
!Report class methodsFor:'queries'!
9551cb7cfe38 Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 218
diff changeset
   109
9551cb7cfe38 Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 218
diff changeset
   110
isAbstract
9551cb7cfe38 Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 218
diff changeset
   111
    "Return if this class is an abstract class.
9551cb7cfe38 Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 218
diff changeset
   112
     True is returned here for myself only; false for subclasses.
9551cb7cfe38 Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 218
diff changeset
   113
     Abstract subclasses must redefine again."
9551cb7cfe38 Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 218
diff changeset
   114
9551cb7cfe38 Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 218
diff changeset
   115
    ^ self == Builder::Report.
9551cb7cfe38 Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 218
diff changeset
   116
! !
9551cb7cfe38 Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 218
diff changeset
   117
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   118
!Report class methodsFor:'running'!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   119
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   120
runClasses: aCollectionOfClasses
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   121
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   122
    ^self runClasses: aCollectionOfClasses named: 'Some classes'
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   123
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   124
    "Created: / 04-08-2011 / 12:25:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   125
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   126
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   127
runClasses: aCollectionOfClasses named: aString
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   128
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   129
    ^self new runClasses: aCollectionOfClasses named: aString
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   130
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   131
    "Modified: / 04-08-2011 / 12:23:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   132
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   133
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   134
runPackage: aString
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   135
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   136
    "Run a report for given package (package id)"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   137
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   138
    ^self runPackages: (Array with: aString)
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   139
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   140
    "Modified (comment): / 04-08-2011 / 12:24:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   141
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   142
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   143
runPackages: packages
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   144
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   145
    "Run a report for given list of packages
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   146
     (package IDs)"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   147
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   148
    ^self new runPackages: packages
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   149
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   150
    "Modified (comment): / 04-08-2011 / 12:24:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   151
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   152
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   153
verbose
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   154
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   155
    ^ Verbose
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   156
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   157
    "Created: / 21-07-2011 / 11:48:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   158
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   159
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   160
verbose: aBoolean
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   161
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   162
    Verbose := aBoolean.
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   163
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   164
    "Created: / 21-07-2011 / 11:48:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   165
! !
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   166
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   167
!Report methodsFor:'accessing'!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   168
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   169
format
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   170
    ^ format
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   171
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   172
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   173
format: aFormatOrString
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   174
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   175
    aFormatOrString isString ifTrue:[
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   176
        format := ReportFormat named: aFormatOrString 
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   177
    ] ifFalse:[
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   178
        format := aFormatOrString 
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   179
    ]
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   180
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   181
    "Created: / 04-08-2011 / 11:55:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   182
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   183
218
82447e847e2d Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 163
diff changeset
   184
ident
82447e847e2d Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 163
diff changeset
   185
    ^ ident
82447e847e2d Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 163
diff changeset
   186
!
82447e847e2d Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 163
diff changeset
   187
82447e847e2d Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 163
diff changeset
   188
ident:aString
82447e847e2d Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 163
diff changeset
   189
    ident := aString.
82447e847e2d Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 163
diff changeset
   190
!
82447e847e2d Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 163
diff changeset
   191
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   192
name
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   193
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   194
    ^name isNil ifTrue:[
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   195
        self defaultName
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   196
    ] ifFalse:[
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   197
        name
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   198
    ]
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   199
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   200
    "Modified: / 07-11-2011 / 09:47:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   201
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   202
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   203
name:aString
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   204
    name := aString.
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   205
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   206
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   207
outputDirectory
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   208
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   209
    ^self class outputDir asFilename
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   210
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   211
    "Created: / 07-10-2011 / 09:12:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   212
! !
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   213
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   214
!Report methodsFor:'accessing-command line options'!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   215
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   216
cmdlineOptionFormat
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   217
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   218
    ^CmdLineOption new
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   219
        short: $F;
163
b8a6ee98534a Initial version of code coverage report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   220
        long: 'format';
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   221
        description: 'Report format to use';
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   222
        action:[:option | self format: option ]
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   223
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   224
    "Created: / 06-11-2011 / 21:49:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
163
b8a6ee98534a Initial version of code coverage report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   225
    "Modified: / 25-06-2013 / 16:02:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   226
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   227
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   228
cmdlineOptionPackage
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   229
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   230
    ^CmdLineOption new
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   231
        short: $p;
163
b8a6ee98534a Initial version of code coverage report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   232
        long: 'package';
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   233
        description: 'Package in which to run the report';
81
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   234
        action:[:option | 
149
3f9e255e7d47 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   235
            packages isNil ifTrue:[ packages := Set new ].
3f9e255e7d47 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   236
            packages add: option.
81
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   237
        ]
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   238
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   239
    "Created: / 06-11-2011 / 21:49:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
163
b8a6ee98534a Initial version of code coverage report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   240
    "Modified: / 25-06-2013 / 16:02:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   241
! !
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   242
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   243
!Report methodsFor:'accessing-defaults'!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   244
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   245
defaultFileSuffix
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   246
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   247
    "Return a default filename suffix. Note that format suffix will be 
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   248
     appended too if not file is explicitely specified"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   249
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   250
    ^self subclassResponsibility
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   251
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   252
    "Created: / 04-08-2011 / 12:47:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   253
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   254
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   255
defaultFormat
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   256
    "raise an error: must be redefined in concrete subclass(es)"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   257
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   258
    ^ self subclassResponsibility
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   259
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   260
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   261
defaultName
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   262
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   263
    ^self class name
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   264
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   265
    "Created: / 07-11-2011 / 09:47:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   266
! !
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   267
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   268
!Report methodsFor:'initialization'!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   269
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   270
setupForClasses: classes
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   271
    "raise an error: must be redefined in concrete subclass(es)"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   272
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   273
    ^ self subclassResponsibility
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   274
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   275
    "Created: / 04-08-2011 / 14:34:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   276
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   277
163
b8a6ee98534a Initial version of code coverage report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   278
setupForPackages:pkgs
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   279
    "raise an error: must be redefined in concrete subclass(es)"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   280
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   281
    ^ self subclassResponsibility
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   282
! !
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   283
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   284
!Report methodsFor:'private'!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   285
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   286
convert:arg
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   287
    ^ self class convert:arg
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   288
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   289
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   290
encode:arg
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   291
    ^ self class encode:arg
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   292
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   293
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   294
encodeFilename:arg
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   295
    ^ self class encodeFilename:arg
81
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   296
!
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   297
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   298
loadPackageIfNotAlready: pkg
142
bbebfa86daea class: Builder::Report
Stefan Vogel <sv@exept.de>
parents: 81
diff changeset
   299
    "Loads a package, if it is not loaded already. 
bbebfa86daea class: Builder::Report
Stefan Vogel <sv@exept.de>
parents: 81
diff changeset
   300
     Raises an error if package cannot be loaded"
81
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   301
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   302
    | def |
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   303
    def := ProjectDefinition definitionClassForPackage:pkg.
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   304
    def isNil ifTrue:[ 
142
bbebfa86daea class: Builder::Report
Stefan Vogel <sv@exept.de>
parents: 81
diff changeset
   305
        (Smalltalk loadPackage:pkg) ifFalse:[
81
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   306
            self error:'Cannot load package: ', pkg.
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   307
        ].
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   308
        def := ProjectDefinition definitionClassForPackage:pkg. 
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   309
    ].
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   310
    def isNil ifTrue:[
142
bbebfa86daea class: Builder::Report
Stefan Vogel <sv@exept.de>
parents: 81
diff changeset
   311
        self error:'Package loaded but project definition not found: ', pkg.
81
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   312
    ].
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   313
a433f1944dca Loads the package if not already loaded.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 76
diff changeset
   314
    "Created: / 13-01-2012 / 12:56:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   315
! !
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   316
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   317
!Report methodsFor:'running'!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   318
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   319
run
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   320
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   321
    self setUp.
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   322
    format writeHeader.
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   323
    [ self runReport ] ensure:[
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   324
        format writeFooter.
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   325
        self tearDown.
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   326
    ]
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   327
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   328
    "Modified: / 04-08-2011 / 12:42:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   329
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   330
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   331
runClasses:classes named:aString 
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   332
    name := aString.
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   333
    self setupForClasses:classes.
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   334
    self run
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   335
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   336
    "Modified: / 04-08-2011 / 14:34:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   337
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   338
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   339
runPackage: package
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   340
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   341
    ^self runPackages: (Array with: package)
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   342
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   343
    "Created: / 04-08-2011 / 12:53:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   344
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   345
163
b8a6ee98534a Initial version of code coverage report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   346
runPackages:pkgs 
b8a6ee98534a Initial version of code coverage report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   347
    pkgs size == 1 
b8a6ee98534a Initial version of code coverage report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   348
        ifTrue:[ name := pkgs anyOne. ]
b8a6ee98534a Initial version of code coverage report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   349
        ifFalse:[ name := ('%1 packages' bindWith:pkgs size). ].
b8a6ee98534a Initial version of code coverage report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   350
    packages := pkgs.
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   351
    ^ self run
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   352
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   353
    "
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   354
        HDTestReport runPackage:'stx:goodies/monticello'
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   355
        HDTestReport runPackage:'stx:libjava'"
163
b8a6ee98534a Initial version of code coverage report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   356
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   357
    "Created: / 04-08-2011 / 12:35:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
163
b8a6ee98534a Initial version of code coverage report.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   358
    "Modified: / 25-06-2013 / 01:03:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   359
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   360
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   361
runReport
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   362
    "Actually run the report. What to do (what classes/packages to check)
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   363
     must be stored instance variables"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   364
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   365
    ^ self subclassResponsibility
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   366
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   367
    "Created: / 04-08-2011 / 12:39:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   368
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   369
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   370
setUp
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   371
218
82447e847e2d Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 163
diff changeset
   372
    | filename stream | 
149
3f9e255e7d47 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   373
3f9e255e7d47 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   374
    packages notNil ifTrue:[
3f9e255e7d47 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   375
        packages do:[:pkg| self loadPackageIfNotAlready: pkg].
3f9e255e7d47 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   376
        self setupForPackages: packages.
3f9e255e7d47 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   377
        packages := nil.
3f9e255e7d47 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   378
    ].
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   379
    format isNil ifTrue:[format := self defaultFormat].
218
82447e847e2d Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 163
diff changeset
   380
    filename :=  '%1-%4%2.%3' bindWith: self name 
82447e847e2d Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 163
diff changeset
   381
                                  with: self defaultFileSuffix 
82447e847e2d Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 163
diff changeset
   382
                                  with: format defaultFileSuffix
82447e847e2d Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 163
diff changeset
   383
                                  with: (ident isNil ifTrue:[''] ifFalse:[ident , '-']).
82447e847e2d Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 163
diff changeset
   384
    stream := (OutputDir / (self encodeFilename:filename)) writeStream.
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   385
    format report: self stream: stream
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   386
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   387
    "Created: / 04-08-2011 / 12:43:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
218
82447e847e2d Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 163
diff changeset
   388
    "Modified: / 22-01-2014 / 10:06:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   389
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   390
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   391
tearDown
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   392
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   393
    format streamFlush; streamClose.
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   394
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   395
    "Created: / 04-08-2011 / 12:43:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   396
! !
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   397
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   398
!Report class methodsFor:'documentation'!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   399
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   400
version
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   401
    ^ '$Header$'
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   402
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   403
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   404
version_CVS
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   405
    ^ '$Header$'
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   406
!
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   407
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   408
version_SVN
149
3f9e255e7d47 class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 142
diff changeset
   409
    ^ '$Id$'
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   410
! !
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   411
142
bbebfa86daea class: Builder::Report
Stefan Vogel <sv@exept.de>
parents: 81
diff changeset
   412
69
4c4c6f784b18 initial checkin
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   413
Report initialize!