author | sr |
Tue, 29 May 2018 16:09:01 +0200 | |
changeset 525 | 84ed1ce7ebba |
parent 243 | 625f6907682a |
child 570 | 9c47ccc9e9b5 |
permissions | -rw-r--r-- |
72 | 1 |
"{ Package: 'stx:goodies/builder/reports' }" |
2 |
||
3 |
"{ NameSpace: Builder }" |
|
4 |
||
5 |
StandaloneStartup subclass:#ReportRunner |
|
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'Builder-Reports' |
|
10 |
! |
|
11 |
||
217
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
12 |
ReportRunner class instanceVariableNames:'parser report debugging setup teardown ident' |
72 | 13 |
|
14 |
" |
|
15 |
The following class instance variables are inherited by this class: |
|
16 |
||
17 |
StandaloneStartup - MutexHandle |
|
217
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
18 |
Object - |
72 | 19 |
" |
20 |
! |
|
21 |
||
22 |
||
23 |
!ReportRunner class methodsFor:'initialization'! |
|
24 |
||
25 |
initialize |
|
26 |
||
27 |
super initialize. |
|
28 |
debugging := Transcript notNil and:[Transcript isView]. |
|
184
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
29 |
self setupSignalHandlers. |
72 | 30 |
|
31 |
"Created: / 06-11-2011 / 22:07:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
184
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
32 |
"Modified: / 28-06-2013 / 01:13:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
72 | 33 |
! ! |
34 |
||
35 |
!ReportRunner class methodsFor:'command line options'! |
|
36 |
||
217
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
37 |
cmdlineOptionIdent |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
38 |
|
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
39 |
^CmdLineOption new |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
40 |
short: $i; |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
41 |
long: 'ident'; |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
42 |
description: 'run/configuration identification'; |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
43 |
action:[:option | |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
44 |
ident := option. |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
45 |
]; |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
46 |
yourself |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
47 |
|
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
48 |
"Created: / 22-01-2014 / 10:00:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
49 |
! |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
50 |
|
72 | 51 |
cmdlineOptionOutputDirectory |
52 |
||
53 |
^CmdLineOption new |
|
54 |
short: $D; |
|
55 |
long: 'output-directory'; |
|
56 |
description: 'Default report output directory'; |
|
188 | 57 |
action:[:outputdir | |
72 | 58 |
Report outputDir: outputdir. |
59 |
self verboseInfo:'Report dir: ' , Report outputDir asString. |
|
217
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
60 |
]; |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
61 |
yourself |
72 | 62 |
|
63 |
"Created: / 06-11-2011 / 09:33:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
217
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
64 |
"Modified: / 22-01-2014 / 10:00:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
72 | 65 |
! |
66 |
||
67 |
cmdlineOptionReport |
|
68 |
||
69 |
^CmdLineOption new |
|
70 |
short: $r; |
|
97
c6a5d1c4df41
changed: #cmdlineOptionReport
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
92
diff
changeset
|
71 |
long: 'report'; |
72 | 72 |
description: 'Report to run'; |
73 |
action:[:option | |
|
74 |
report := Smalltalk at: option asSymbol. |
|
75 |
report isNil ifTrue:[ |
|
188 | 76 |
Stderr nextPutLine:('ERROR: Report class %1 does not exist (forgot to load package?)' bindWith: option). |
77 |
"/Smalltalk exit: 1. |
|
72 | 78 |
]. |
79 |
report := report new. |
|
80 |
parser options addAll: (CmdLineOption optionsFor: report) |
|
217
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
81 |
]; |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
82 |
yourself |
72 | 83 |
|
84 |
"Created: / 06-11-2011 / 09:45:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
217
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
85 |
"Modified: / 22-01-2014 / 10:00:56 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
147
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
86 |
! |
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
87 |
|
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
88 |
cmdlineOptionSetup |
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
89 |
|
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
90 |
^CmdLineOption new |
225
07dd0c1e4e6d
Fixed setup option, meant to be -S
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
217
diff
changeset
|
91 |
short: $S; |
147
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
92 |
long: 'setup'; |
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
93 |
description: 'Code executed before tests are loaded and executed'; |
188 | 94 |
action:[:option | |
147
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
95 |
setup := option |
217
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
96 |
]; |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
97 |
yourself |
147
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
98 |
|
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
99 |
"Created: / 15-05-2013 / 16:50:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
225
07dd0c1e4e6d
Fixed setup option, meant to be -S
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
217
diff
changeset
|
100 |
"Modified: / 24-01-2014 / 15:26:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
147
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
101 |
! |
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
102 |
|
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
103 |
cmdlineOptionTeardown |
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
104 |
|
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
105 |
^CmdLineOption new |
217
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
106 |
short: $T; |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
107 |
long: 'teardown'; |
147
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
108 |
description: 'Code executed after all tests are executed'; |
188 | 109 |
action:[:option | |
147
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
110 |
teardown := option |
217
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
111 |
]; |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
112 |
yourself |
147
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
113 |
|
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
114 |
"Created: / 15-05-2013 / 16:50:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
217
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
115 |
"Modified: / 22-01-2014 / 10:01:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
72 | 116 |
! ! |
117 |
||
184
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
118 |
!ReportRunner class methodsFor:'debugging'! |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
119 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
120 |
dumpProcess: aProcess |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
121 |
Stderr cr; cr |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
122 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
123 |
"Created: / 27-06-2013 / 23:41:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
124 |
! |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
125 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
126 |
dumpProcess: aProcess on: aStream |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
127 |
| ctx | |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
128 |
aStream cr; cr. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
129 |
aStream nextPutAll: '== ['; nextPutAll: aProcess id printString; nextPutAll:'] '; nextPutAll: aProcess name; nextPutAll: ' =='; cr. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
130 |
aStream cr. |
238
c5047b0ed211
Dump all threads when testcase times out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
232
diff
changeset
|
131 |
aStream nextPutAll: ' State: '; nextPutAll: aProcess state printString; cr. |
c5047b0ed211
Dump all threads when testcase times out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
232
diff
changeset
|
132 |
aStream nextPutAll: ' Group: '; nextPutAll: aProcess processGroupId printString; cr. |
c5047b0ed211
Dump all threads when testcase times out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
232
diff
changeset
|
133 |
aStream nextPutAll: ' Creator: '; nextPutAll: aProcess processGroupId printString; cr. |
c5047b0ed211
Dump all threads when testcase times out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
232
diff
changeset
|
134 |
aStream nextPutAll: ' Stack: '; cr; cr. |
184
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
135 |
|
188 | 136 |
aProcess == Processor activeProcess ifTrue:[ctx := thisContext] ifFalse:[ctx := aProcess suspendedContext]. |
184
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
137 |
[ ctx notNil ] whileTrue:[ |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
138 |
aStream nextPutAll: ' '. |
188 | 139 |
ctx fullPrintOn: aStream. |
184
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
140 |
aStream cr. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
141 |
ctx := ctx sender. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
142 |
]. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
143 |
aStream cr. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
144 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
145 |
" |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
146 |
self dumpProcess: Processor activeProcess on: Transcript. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
147 |
" |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
148 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
149 |
"Created: / 28-06-2013 / 01:00:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
238
c5047b0ed211
Dump all threads when testcase times out.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
232
diff
changeset
|
150 |
"Modified: / 06-06-2014 / 09:14:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
184
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
151 |
! |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
152 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
153 |
dumpProcesses |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
154 |
self dumpProcessesOn: Stderr |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
155 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
156 |
" |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
157 |
self dumpProcessesOn: Transcript. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
158 |
" |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
159 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
160 |
"Created: / 27-06-2013 / 23:41:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
161 |
"Modified (comment): / 28-06-2013 / 01:06:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
162 |
! |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
163 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
164 |
dumpProcessesOn: aStream |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
165 |
Process allInstancesDo:[:process| |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
166 |
process isDead ifFalse:[ |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
167 |
self dumpProcess: process on: aStream |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
168 |
] |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
169 |
] |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
170 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
171 |
"Created: / 27-06-2013 / 23:42:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
172 |
! ! |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
173 |
|
72 | 174 |
!ReportRunner class methodsFor:'defaults'! |
175 |
||
77 | 176 |
allowCoverageMeasurementOption |
177 |
||
178 |
^false "CoverageReport will do that" |
|
179 |
||
180 |
"Created: / 13-01-2012 / 11:48:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
181 |
! |
|
182 |
||
72 | 183 |
allowDebugOption |
184 |
||
185 |
^true |
|
186 |
||
187 |
"Created: / 21-07-2011 / 09:48:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
188 |
! ! |
|
189 |
||
190 |
!ReportRunner class methodsFor:'multiple applications support'! |
|
191 |
||
192 |
applicationRegistryPath |
|
193 |
"the key under which this application stores its process ID in the registry |
|
194 |
as a collection of path-components. |
|
195 |
i.e. if #('foo' 'bar' 'baz') is returned here, the current applications ID will be stored |
|
196 |
in HKEY_CURRENT_USER\Software\foo\bar\baz\CurrentID. |
|
197 |
(would also be used as a relative path for a temporary lock file under unix). |
|
198 |
Used to detect if another instance of this application is already running." |
|
199 |
||
200 |
^ #('exept' 'smalltallx' 'hdreportrunner') |
|
201 |
||
202 |
"Modified: / 21-07-2011 / 09:43:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
203 |
! |
|
204 |
||
205 |
applicationUUID |
|
206 |
"answer an application-specific unique uuid. |
|
207 |
This is used as the name of some exclusive OS-resource, which is used to find out, |
|
208 |
if another instance of this application is already running. |
|
209 |
Under win32, a mutex is used; under unix, an exclusive file in the tempDir could be used." |
|
210 |
||
211 |
^ '99f65c80-b375-11e0-86ad-0013e89c0459' asUUID |
|
212 |
||
213 |
"Modified: / 21-07-2011 / 09:44:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
214 |
! ! |
|
215 |
||
216 |
!ReportRunner class methodsFor:'startup'! |
|
217 |
||
184
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
218 |
handleSIGTERM |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
219 |
self dumpProcesses. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
220 |
debugging ifFalse:[ |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
221 |
Smalltalk exit:127. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
222 |
]. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
223 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
224 |
"Created: / 27-06-2013 / 23:10:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
225 |
"Modified: / 28-06-2013 / 01:08:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
226 |
! |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
227 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
228 |
handleSIGUSR2 |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
229 |
self dumpProcesses |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
230 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
231 |
"Created: / 27-06-2013 / 23:10:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
232 |
! |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
233 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
234 |
setupSignalHandlers |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
235 |
"On UNIX, this sets up a custom signal handler on SIGUSR2 and SIGTERM that |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
236 |
dumps stacks on all threads" |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
237 |
|
188 | 238 |
| sigusr2 sigterm | |
239 |
||
184
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
240 |
OperatingSystem isUNIXlike ifTrue:[ |
188 | 241 |
|
184
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
242 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
243 |
sigterm := Signal new. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
244 |
sigterm handlerBlock: [:ex | self handleSIGTERM]. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
245 |
OperatingSystem operatingSystemSignal:OperatingSystem sigTERM install: sigterm. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
246 |
OperatingSystem enableSignal: OperatingSystem sigTERM. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
247 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
248 |
sigusr2 := Signal new. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
249 |
sigusr2 handlerBlock: [:ex | self handleSIGUSR2]. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
250 |
OperatingSystem operatingSystemSignal:OperatingSystem sigUSR2 install: sigusr2. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
251 |
OperatingSystem enableSignal: OperatingSystem sigUSR2. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
252 |
]. |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
253 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
254 |
" |
188 | 255 |
OperatingSystem sendSignal: OperatingSystem sigUSR2 to: OperatingSystem getProcessId |
184
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
256 |
" |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
257 |
|
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
258 |
"Created: / 27-06-2013 / 20:57:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
259 |
"Modified: / 28-06-2013 / 01:11:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
260 |
! |
5f75ffc9642b
Install signal handlers for SIGUSR2 and SIGTERM that dumps
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
147
diff
changeset
|
261 |
|
72 | 262 |
setupToolsForDebug |
263 |
||
264 |
super setupToolsForDebug. |
|
265 |
debugging := true. |
|
266 |
||
267 |
"Created: / 06-11-2011 / 22:06:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
77 | 268 |
! |
269 |
||
217
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
270 |
start |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
271 |
Smalltalk silentLoading: true. |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
272 |
^ super start. |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
273 |
|
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
274 |
"Created: / 22-01-2014 / 09:17:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
275 |
! |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
276 |
|
77 | 277 |
usage |
278 |
||
279 |
Stderr nextPutAll:'usage: report-runner.'; |
|
280 |
nextPutAll: (OperatingSystem isMSWINDOWSlike ifTrue:['bat'] ifFalse:['sh']); |
|
281 |
nextPutAll: ' [-D <dir>] -r <report> [-p <package1> [-p <package2> [...]]]'; cr. |
|
282 |
||
232
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
283 |
Stderr nextPutLine:'Common options:'; cr. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
284 |
|
77 | 285 |
Stderr nextPutLine:' --help .................. output this message'. |
232
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
286 |
"/ Stderr nextPutLine:' --verbose ............... verbose startup'. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
287 |
"/ Stderr nextPutLine:' --noBanner .............. no splash screen'. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
288 |
"/ Stderr nextPutLine:' --newAppInstance ........ start as its own application process (do not reuse'. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
289 |
"/ Stderr nextPutLine:' a running instance)'. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
290 |
"/ self allowScriptingOption ifTrue:[ |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
291 |
"/ Stderr nextPutLine:' --scripting portNr ...enable scripting via port (or stdin/stdOut if 0)'. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
292 |
"/ ]. |
77 | 293 |
self allowDebugOption ifTrue:[ |
294 |
Stderr nextPutLine:' --debug ................. enable Debugger'. |
|
295 |
]. |
|
296 |
"/ ' ......................... ' |
|
297 |
Stderr nextPutLine:' -D <dir>'. |
|
298 |
Stderr nextPutLine:' --output-directory=<dir> directory where report files will go'. |
|
217
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
299 |
Stderr nextPutLine:' -S <expr>'. |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
300 |
Stderr nextPutLine:' --setup=<expr> .......... smalltalk expression that is evaluated before'. |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
301 |
Stderr nextPutLine:' any report is run'. |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
302 |
Stderr nextPutLine:' -T <expr>'. |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
303 |
Stderr nextPutLine:' --teardown=<expr> ....... smalltalk expression that is evaluated before'. |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
304 |
Stderr nextPutLine:' after all reports finished'. |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
305 |
Stderr nextPutLine:' -i <ident>'. |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
306 |
Stderr nextPutLine:' --ident=<ident> ......... run/configuration identification string to'. |
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
307 |
Stderr nextPutLine:' use when creating output files'. |
77 | 308 |
Stderr nextPutLine:' -r <report class>'. |
309 |
Stderr nextPutLine:' --report=<report class> . report to run. available reports:'. |
|
310 |
Report available do:[:report| |
|
311 |
Stderr nextPutAll:' '; nextPutLine: report name |
|
312 |
]. |
|
313 |
Stderr nextPutLine:' -p <package>'. |
|
314 |
Stderr nextPutLine:' --package=<package> ..... package to run report on'. |
|
315 |
Stderr nextPutLine:' May be specified multiple times.'. |
|
232
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
316 |
|
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
317 |
Report available do:[:cls| |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
318 |
self usageForReportClass: cls. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
319 |
]. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
320 |
|
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
321 |
|
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
322 |
debugging ifFalse:[ |
217
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
323 |
Smalltalk exit:1. |
232
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
324 |
]. |
77 | 325 |
" |
326 |
self usage |
|
327 |
" |
|
328 |
||
329 |
"Created: / 13-01-2012 / 11:48:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
232
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
330 |
"Modified: / 27-05-2014 / 17:02:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
331 |
! |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
332 |
|
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
333 |
usageForReportClass: class |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
334 |
| options | |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
335 |
|
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
336 |
"/ '.........................' size 25 |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
337 |
options := CmdLineOption optionsFor: class new. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
338 |
options := options reject:[:option | 'pF' includes: option short ]. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
339 |
options notEmptyOrNil ifTrue:[ |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
340 |
Stderr cr. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
341 |
Stderr nextPutAll: class name; nextPutLine:' options:'; cr. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
342 |
options do:[:option | |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
343 |
| optlen | |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
344 |
|
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
345 |
option short notNil ifTrue:[ |
243
625f6907682a
Tiny fix in help formatting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
238
diff
changeset
|
346 |
Stderr nextPutAll: ' '. |
232
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
347 |
Stderr nextPut: $-; nextPut: option short; space. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
348 |
optlen := 2. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
349 |
option hasParam ifTrue:[ |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
350 |
| paramName | |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
351 |
|
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
352 |
paramName := 'val'. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
353 |
Stderr nextPut:$<; nextPutAll: paramName; nextPut:$>; space. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
354 |
optlen := optlen + 3 + paramName size. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
355 |
]. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
356 |
]. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
357 |
option long notNil ifTrue:[ |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
358 |
option short notNil ifTrue:[ |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
359 |
Stderr cr. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
360 |
]. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
361 |
Stderr nextPutAll: ' --'. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
362 |
Stderr nextPutAll: option long. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
363 |
optlen := option long size + 2. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
364 |
option hasParam ifTrue:[ |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
365 |
| paramName | |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
366 |
|
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
367 |
paramName := 'val'. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
368 |
Stderr nextPut:$=; nextPut:$<; nextPutAll: paramName; nextPut:$>. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
369 |
optlen := optlen + 3 + paramName size. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
370 |
]. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
371 |
Stderr space. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
372 |
]. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
373 |
Stderr next: (26 - 1"space" -2"--" - optlen) put: $.. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
374 |
Stderr space. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
375 |
option description notNil ifTrue:[ |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
376 |
Stderr nextPutAll: option description |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
377 |
]. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
378 |
Stderr cr. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
379 |
] |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
380 |
] |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
381 |
|
243
625f6907682a
Tiny fix in help formatting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
238
diff
changeset
|
382 |
" |
625f6907682a
Tiny fix in help formatting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
238
diff
changeset
|
383 |
ReportRunner usageForReportClass: TestReport. |
625f6907682a
Tiny fix in help formatting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
238
diff
changeset
|
384 |
" |
625f6907682a
Tiny fix in help formatting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
238
diff
changeset
|
385 |
|
232
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
386 |
"Created: / 27-05-2014 / 16:42:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
243
625f6907682a
Tiny fix in help formatting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
238
diff
changeset
|
387 |
"Modified: / 16-06-2014 / 11:25:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
72 | 388 |
! ! |
389 |
||
390 |
!ReportRunner class methodsFor:'startup-to be redefined'! |
|
391 |
||
189
bd2bed33aba7
Fixes to make it running on Smalltalk/X 6.2.2 released in July 2012
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
188
diff
changeset
|
392 |
main:argv0 |
143 | 393 |
"Process command line arguments" |
102
a63aa44303e3
changed: #main: - support for not-officially-supported VM options
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
97
diff
changeset
|
394 |
|
189
bd2bed33aba7
Fixes to make it running on Smalltalk/X 6.2.2 released in July 2012
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
188
diff
changeset
|
395 |
| argv | |
bd2bed33aba7
Fixes to make it running on Smalltalk/X 6.2.2 released in July 2012
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
188
diff
changeset
|
396 |
|
bd2bed33aba7
Fixes to make it running on Smalltalk/X 6.2.2 released in July 2012
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
188
diff
changeset
|
397 |
argv := argv0 asOrderedCollection. |
232
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
398 |
argv isEmpty ifTrue:[ |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
399 |
self usage. |
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
400 |
]. |
189
bd2bed33aba7
Fixes to make it running on Smalltalk/X 6.2.2 released in July 2012
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
188
diff
changeset
|
401 |
argv remove: '--abortOnSEGV' ifAbsent:[nil]. |
72 | 402 |
parser := CmdLineParser new. |
144 | 403 |
CmdLineOptionError autoload. |
404 |
||
188 | 405 |
[ |
406 |
parser parse: argv for: self. |
|
143 | 407 |
] on:CmdLineOptionError do:[:ex| |
72 | 408 |
Stderr nextPutLine:'Error when processing options: ', ex description. |
188 | 409 |
debugging ifFalse:[ |
92 | 410 |
ex suspendedContext fullPrintAllOn: Stderr. |
72 | 411 |
Stderr nextPutLine:'Exiting'. |
412 |
Smalltalk exit:1. |
|
413 |
] ifTrue:[ |
|
414 |
ex pass |
|
188 | 415 |
] |
72 | 416 |
]. |
417 |
||
230
9e0098682d8c
Fix in Builder::ReportRunner>>#main:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
225
diff
changeset
|
418 |
debugging ifFalse:[ |
9e0098682d8c
Fix in Builder::ReportRunner>>#main:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
225
diff
changeset
|
419 |
NoHandlerError emergencyHandler:(NoHandlerError abortingEmergencyHandler) |
9e0098682d8c
Fix in Builder::ReportRunner>>#main:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
225
diff
changeset
|
420 |
]. |
9e0098682d8c
Fix in Builder::ReportRunner>>#main:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
225
diff
changeset
|
421 |
|
72 | 422 |
[ |
147
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
423 |
setup notNil ifTrue:[Compiler evaluate: setup]. |
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
424 |
[ |
217
054062587f02
Added -i | --ident option to report-runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
189
diff
changeset
|
425 |
report ident: ident. |
147
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
426 |
report run. |
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
427 |
] ensure:[ |
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
428 |
teardown notNil ifTrue:[Compiler evaluate: teardown]. |
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
429 |
]. |
72 | 430 |
debugging ifFalse:[ |
431 |
Smalltalk exit:0. |
|
432 |
]. |
|
433 |
] on: Error do:[:ex| |
|
434 |
Stderr nextPutAll:'Error when running tests: '. |
|
435 |
Stderr nextPutAll:ex description; cr. |
|
436 |
ex suspendedContext printAllOn:Stderr. |
|
147
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
437 |
|
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
438 |
|
72 | 439 |
debugging ifFalse:[ |
440 |
Smalltalk exit:1. |
|
441 |
] ifTrue:[ |
|
442 |
ex pass |
|
443 |
] |
|
444 |
] |
|
445 |
||
232
3c3f5f58ddeb
Better command line help for standalone report runner.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
230
diff
changeset
|
446 |
"Modified: / 27-05-2014 / 17:05:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
72 | 447 |
! ! |
448 |
||
449 |
!ReportRunner class methodsFor:'documentation'! |
|
450 |
||
451 |
version |
|
452 |
^ '$Header$' |
|
453 |
! |
|
454 |
||
455 |
version_CVS |
|
456 |
^ '$Header$' |
|
457 |
! |
|
458 |
||
459 |
version_SVN |
|
147
9f2935d68582
class: Builder::ReportRunner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
144
diff
changeset
|
460 |
^ '$Id$' |
72 | 461 |
! ! |
462 |
||
143 | 463 |
|
72 | 464 |
ReportRunner initialize! |