author | Claus Gittinger <cg@exept.de> |
Thu, 11 Jan 2001 17:00:24 +0100 | |
changeset 20 | 5bca85f3769d |
parent 19 | 5942ea175447 |
child 21 | 81a20883f04a |
permissions | -rw-r--r-- |
0 | 1 |
"{ Package: 'stx:goodies/sunit' }" |
2 |
||
3 |
ApplicationModel subclass:#TestRunner |
|
4 |
instanceVariableNames:'result lastPass defect allDefects defectMenu details mode |
|
19 | 5 |
scriptModel script numberOfTestsToRun' |
0 | 6 |
classVariableNames:'' |
7 |
poolDictionaries:'' |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
8 |
category:'SUnit-UI' |
0 | 9 |
! |
10 |
||
11 | 11 |
|
8 | 12 |
!TestRunner class methodsFor:'defaults'! |
13 |
||
14 |
defaultIcon |
|
15 |
"This resource specification was automatically generated |
|
16 |
by the ImageEditor of ST/X." |
|
17 |
||
18 |
"Do not manually edit this!! If it is corrupted, |
|
19 |
the ImageEditor may not be able to read the specification." |
|
20 |
||
21 |
" |
|
22 |
self defaultIcon inspect |
|
23 |
ImageEditor openOnClass:self andSelector:#defaultIcon |
|
24 |
" |
|
25 |
||
26 |
<resource: #image> |
|
27 |
||
28 |
^Icon |
|
29 |
constantNamed:#'TestRunner class defaultIcon' |
|
30 |
ifAbsentPut:[(Depth4Image new) width: 28; height: 28; photometric:(#palette); bitsPerSample:(#(4 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
31 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@O??C???????C?<O?0@@??<O??????<O?0??@@@@@@@@@@@@@@@@@@@@@BH"H"H" |
|
32 |
H"H"H#L3L0@@H"H"H"H"H"H#L3L3@@@"H"H"H"H"H#L3L3L@@BH"H"H"H"H#L3L3L0@@H"H"H"H@@@L1L3L3@@@"H"H"HO??<A@3L3L@@BH"H"HO???1@3L3 |
|
33 |
L0@@H"H"HO???1@@L3L3@@@"H"H <_?1@O@3L3L@@BH"H"C0G1@O<CL3L0@@H"H"HO@A@O?0L3L3@@@"H"H ?0@O??@3L3L@@BH"H#LO<O??@3L3L0@@H"H# |
|
34 |
L3C???@3L3L3@@@"H#L3L0@@@3L3L3L@@BH#L3L3L3L3L3L3L0@@H#L3L3L3L3L3L3L3@@@#L3L3L3L3L3L3L3L@@CL3L3L3L3L3L3L3L0@@@@@@@@@@@@@@ |
|
35 |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@b') ; colorMapFromArray:#[0 0 0 255 255 255 255 0 0 0 255 0 0 0 255 0 255 255 255 255 0 255 0 255 127 0 0 0 127 0 0 0 127 0 127 127 127 127 0 127 0 127 127 127 127 170 170 170]; mask:((Depth1Image new) width: 28; height: 28; photometric:(#blackIs0); bitsPerSample:(#(1 )); samplesPerPixel:(1); bits:(ByteArray fromPackedString:' |
|
36 |
@@@@@@@@@@A???? _???8G???>A???? _???8G???>A???? _???8G???>A???? _???8G???>A???? _???8G???>A???? _???8G???>A???? _???8G?? |
|
37 |
?>A???? _???8G???>@@@@@@@@@@@@@a') ; yourself); yourself] |
|
38 |
! ! |
|
39 |
||
0 | 40 |
!TestRunner class methodsFor:'interface specs'! |
41 |
||
42 |
windowSpec |
|
43 |
"This resource specification was automatically generated |
|
44 |
by the UIPainter of ST/X." |
|
45 |
||
46 |
"Do not manually edit this!! If it is corrupted, |
|
47 |
the UIPainter may not be able to read the specification." |
|
48 |
||
49 |
" |
|
50 |
UIPainter new openOnClass:TestRunner andSelector:#windowSpec |
|
51 |
TestRunner new openInterface:#windowSpec |
|
52 |
TestRunner open |
|
53 |
" |
|
54 |
||
55 |
<resource: #canvas> |
|
56 |
||
57 |
^ |
|
58 |
#(#FullSpec |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
59 |
#name: #windowSpec |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
60 |
#window: |
0 | 61 |
#(#WindowSpec |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
62 |
#label: 'SUnit Camp Smalltalk 2.7b TestRunner' |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
63 |
#name: 'SUnit Camp Smalltalk 2.7b TestRunner' |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
64 |
#min: #(#Point 362 122) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
65 |
#bounds: #(#Rectangle 16 46 509 221) |
8 | 66 |
#icon: #defaultIcon |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
67 |
) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
68 |
#component: |
0 | 69 |
#(#SpecCollection |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
70 |
#collection: #( |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
71 |
#(#ActionButtonSpec |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
72 |
#label: 'Refresh' |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
73 |
#name: 'Button3' |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
74 |
#layout: #(#LayoutFrame 0 0 0 0 75 0 24 0) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
75 |
#model: #refreshSuites |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
76 |
) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
77 |
#(#MenuButtonSpec |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
78 |
#label: 'ExampleSetTest' |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
79 |
#name: #tests |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
80 |
#layout: #(#LayoutFrame 76 0 0 0 -216 1 24 0) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
81 |
#model: #script |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
82 |
#menu: #scriptModel |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
83 |
#useIndex: true |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
84 |
) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
85 |
#(#ActionButtonSpec |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
86 |
#label: 'Run' |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
87 |
#name: 'Button1' |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
88 |
#layout: #(#LayoutFrame -215 1 0 0 -160 1 24 0) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
89 |
#model: #runTests |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
90 |
#enableChannel: #enableRunButton |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
91 |
) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
92 |
#(#ActionButtonSpec |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
93 |
#label: 'ReRun Defects' |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
94 |
#name: 'Button5' |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
95 |
#layout: #(#LayoutFrame -159 1 0 0 -57 1 24 0) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
96 |
#model: #runDefects |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
97 |
#enableChannel: #enableRunDefectsButton |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
98 |
) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
99 |
#(#ActionButtonSpec |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
100 |
#label: 'Run All' |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
101 |
#name: 'Button2' |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
102 |
#layout: #(#LayoutFrame -56 1 0 0 0 1 24 0) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
103 |
#model: #runAllTests |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
104 |
) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
105 |
#(#LabelSpec |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
106 |
#label: 'N/A' |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
107 |
#name: 'mode' |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
108 |
#layout: #(#LayoutFrame 0 0 25 0 0 1 0 0.5) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
109 |
#style: #(#FontDescription #Arial #bold #roman 14) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
110 |
#labelChannel: #mode |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
111 |
) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
112 |
#(#LabelSpec |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
113 |
#label: '...' |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
114 |
#name: 'details' |
19 | 115 |
#layout: #(#LayoutFrame 0 0 0 0.5 0 1 -25 1) |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
116 |
#labelChannel: #details |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
117 |
) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
118 |
#(#MenuButtonSpec |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
119 |
#name: #defects |
10 | 120 |
#layout: #(#LayoutFrame 0 0 -24 1 -152 1 0 1) |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
121 |
#isOpaque: true |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
122 |
#flags: 40 |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
123 |
#model: #selectionHolder |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
124 |
#initiallyDisabled: true |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
125 |
#enableChannel: #enableDefectsList |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
126 |
#menu: #defectMenu |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
127 |
) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
128 |
#(#ActionButtonSpec |
10 | 129 |
#label: 'Browse' |
130 |
#name: 'Button4' |
|
131 |
#layout: #(#LayoutFrame -151 1 -24 1 -76 1 0 1) |
|
132 |
#model: #browseSelectedTestCase |
|
133 |
#initiallyDisabled: true |
|
134 |
#enableChannel: #enableRunButton |
|
135 |
) |
|
136 |
#(#ActionButtonSpec |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
137 |
#label: 'Debug' |
10 | 138 |
#name: 'Button6' |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
139 |
#layout: #(#LayoutFrame -75 1 -24 1 0 1 0 1) |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
140 |
#model: #debugSelectedFailure |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
141 |
#initiallyDisabled: true |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
142 |
#enableChannel: #enableDebugButton |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
143 |
) |
19 | 144 |
#(#ProgressIndicatorSpec |
145 |
#name: 'ProgressIndicator1' |
|
146 |
#layout: #(#LayoutFrame 0 0.0 25 0 0 1.0 36 0) |
|
147 |
#visibilityChannel: #percentageIndicatorVisible |
|
148 |
#model: #percentageDone |
|
149 |
#foregroundColor: #(#Color 32.9992 32.9992 0.0) |
|
150 |
#backgroundColor: #(#Color 66.9993 66.9993 0.0) |
|
151 |
#showPercentage: false |
|
152 |
) |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
153 |
) |
0 | 154 |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
155 |
) |
0 | 156 |
) |
157 |
! ! |
|
158 |
||
159 |
!TestRunner class methodsFor:'opening'! |
|
160 |
||
161 |
open |
|
162 |
||
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
163 |
^super open |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
164 |
! |
5 | 165 |
|
166 |
openOnTestCase:aTestCaseSubclass |
|
167 |
|runner idx| |
|
168 |
||
169 |
runner := self new. |
|
170 |
runner open. |
|
171 |
runner window waitUntilVisible. |
|
15 | 172 |
|
5 | 173 |
idx := runner scriptModel value indexOf:aTestCaseSubclass name. |
174 |
runner script value:idx. |
|
175 |
||
176 |
" |
|
177 |
self openOnTestCase:CompilerTest |
|
178 |
" |
|
179 |
! ! |
|
0 | 180 |
|
181 |
!TestRunner class methodsFor:'plugIn spec'! |
|
182 |
||
183 |
aspectSelectors |
|
184 |
"This resource specification was automatically generated |
|
185 |
by the UIPainter of ST/X." |
|
186 |
||
187 |
"Do not manually edit this. If it is corrupted, |
|
188 |
the UIPainter may not be able to read the specification." |
|
189 |
||
190 |
"Return a description of exported aspects; |
|
191 |
these can be connected to aspects of an embedding application |
|
192 |
(if this app is embedded in a subCanvas)." |
|
193 |
||
194 |
^ #( |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
195 |
#script |
0 | 196 |
). |
197 |
||
198 |
! ! |
|
199 |
||
200 |
!TestRunner methodsFor:'Accessing'! |
|
201 |
||
202 |
defectMenu |
|
203 |
"automatically generated by UIPainter ..." |
|
204 |
||
205 |
"*** the code below creates a default model when invoked." |
|
206 |
"*** (which may not be the one you wanted)" |
|
207 |
"*** Please change as required and accept it in the browser." |
|
208 |
||
209 |
^defectMenu isNil |
|
210 |
ifTrue: [defectMenu := OrderedCollection new asValue] |
|
211 |
ifFalse: [defectMenu] |
|
212 |
||
213 |
"Modified: / 4.4.2000 / 20:00:31 / Sames" |
|
214 |
! |
|
215 |
||
216 |
defects |
|
217 |
||
218 |
^self builder componentAt: #defects |
|
219 |
||
220 |
"Created: / 21.6.2000 / 12:19:29 / Sames" |
|
221 |
! |
|
222 |
||
223 |
details |
|
224 |
"This method was generated by UIDefiner. Any edits made here |
|
225 |
may be lost whenever methods are automatically defined. The |
|
226 |
initialization provided below may have been preempted by an |
|
227 |
initialize method." |
|
228 |
||
229 |
^details isNil |
|
230 |
ifTrue: |
|
231 |
[details := '...' asValue] |
|
232 |
ifFalse: |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
233 |
[details] |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
234 |
! |
0 | 235 |
|
236 |
mode |
|
237 |
"This method was generated by UIDefiner. Any edits made here |
|
238 |
may be lost whenever methods are automatically defined. The |
|
239 |
initialization provided below may have been preempted by an |
|
240 |
initialize method." |
|
241 |
||
242 |
^mode isNil |
|
243 |
ifTrue: |
|
244 |
[mode := 'N/A' asValue] |
|
245 |
ifFalse: |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
246 |
[mode] |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
247 |
! |
0 | 248 |
|
19 | 249 |
percentageDone |
250 |
|holder| |
|
251 |
||
252 |
(holder := builder bindingAt:#percentageDone) isNil ifTrue:[ |
|
253 |
holder := 0 asValue. |
|
254 |
builder aspectAt:#percentageDone put:holder. |
|
255 |
]. |
|
256 |
^ holder. |
|
257 |
! |
|
258 |
||
259 |
percentageIndicatorVisible |
|
260 |
|holder| |
|
261 |
||
262 |
(holder := builder bindingAt:#percentageIndicatorVisible) isNil ifTrue:[ |
|
263 |
holder := false asValue. |
|
264 |
builder aspectAt:#percentageIndicatorVisible put:holder. |
|
265 |
]. |
|
266 |
^ holder. |
|
267 |
! |
|
268 |
||
0 | 269 |
script |
270 |
"automatically generated by UIPainter ..." |
|
271 |
||
272 |
"*** the code below creates a default model when invoked." |
|
273 |
"*** (which may not be the one you wanted)" |
|
274 |
"*** Please change as required and accept it in the browser." |
|
275 |
||
276 |
|holder| |
|
277 |
||
278 |
(holder := builder bindingAt:#script) isNil ifTrue:[ |
|
11 | 279 |
holder := ValueHolder new. |
280 |
builder aspectAt:#script put:holder. |
|
281 |
holder onChangeSend:#scriptSelectionChanged to:self. |
|
0 | 282 |
"/ holder addDependent:self. |
283 |
]. |
|
284 |
^ holder. |
|
285 |
||
286 |
"Created: / 21.6.2000 / 12:04:36 / Sames" |
|
287 |
! |
|
288 |
||
289 |
script:something |
|
290 |
"automatically generated by UIPainter ..." |
|
291 |
||
292 |
"This method is used when I am embedded as subApplication," |
|
293 |
"and the mainApp wants to connect its aspects to mine." |
|
294 |
||
295 |
"/ |holder| |
|
296 |
||
297 |
"/ (holder := builder bindingAt:#script) notNil ifTrue:[ |
|
298 |
"/ holder removeDependent:self. |
|
299 |
"/ ]. |
|
300 |
builder aspectAt:#script put:something. |
|
301 |
"/ something notNil ifTrue:[ |
|
302 |
"/ something addDependent:self. |
|
303 |
"/ ]. |
|
304 |
^ self. |
|
305 |
||
306 |
"Created: / 21.6.2000 / 12:04:36 / Sames" |
|
307 |
! |
|
308 |
||
309 |
scriptModel |
|
310 |
"This method was generated by UIDefiner. Any edits made here |
|
311 |
may be lost whenever methods are automatically defined. The |
|
312 |
initialization provided below may have been preempted by an |
|
313 |
initialize method." |
|
314 |
||
315 |
^scriptModel isNil |
|
316 |
ifTrue: [scriptModel := (TestCase allSubclasses collect: [:each | each name]) asValue] |
|
317 |
ifFalse: [scriptModel] |
|
318 |
||
319 |
"Modified: / 2.4.2000 / 14:37:51 / Sames" |
|
320 |
! |
|
321 |
||
322 |
selection |
|
323 |
||
324 |
^defect |
|
325 |
||
326 |
"Created: / 4.4.2000 / 18:50:55 / Sames" |
|
327 |
! |
|
328 |
||
329 |
selectionHolder |
|
330 |
"automatically generated by UIPainter ..." |
|
331 |
||
332 |
"*** the code below creates a default model when invoked." |
|
333 |
"*** (which may not be the one you wanted)" |
|
334 |
"*** Please change as required and accept it in the browser." |
|
335 |
||
336 |
|holder| |
|
337 |
||
338 |
(holder := builder bindingAt:#selectionHolder) isNil ifTrue:[ |
|
339 |
holder := AspectAdaptor new subject:self; forAspect:#selection. |
|
340 |
builder aspectAt:#selectionHolder put:holder. |
|
341 |
"/ holder addDependent:self. |
|
342 |
]. |
|
343 |
^ holder. |
|
344 |
||
345 |
"Created: / 4.4.2000 / 18:46:08 / Sames" |
|
346 |
"Modified: / 4.4.2000 / 18:47:31 / Sames" |
|
347 |
! |
|
348 |
||
349 |
tests |
|
350 |
||
351 |
^self builder componentAt: #tests |
|
352 |
||
353 |
"Created: / 4.4.2000 / 19:57:37 / Sames" |
|
354 |
! ! |
|
355 |
||
356 |
!TestRunner methodsFor:'Actions'! |
|
357 |
||
10 | 358 |
browseSelectedTestCase |
359 |
|testCaseName testCase| |
|
360 |
||
361 |
testCaseName := self scriptModel value at:(self script value). |
|
362 |
testCase := Smalltalk at:testCaseName asSymbol. |
|
363 |
testCase notNil ifTrue:[ |
|
16 | 364 |
(UserPreferences current systemBrowserClass openInClass:testCase) |
365 |
selectProtocolsMatching:'*' |
|
10 | 366 |
] |
367 |
! |
|
368 |
||
0 | 369 |
debugSelectedFailure |
370 |
self debugTest: self selection |
|
371 |
||
372 |
"Created: / 21.6.2000 / 10:58:58 / Sames" |
|
373 |
"Modified: / 21.6.2000 / 12:21:05 / Sames" |
|
374 |
! |
|
375 |
||
376 |
debugTest: aTestCaseName |
|
377 |
| testCase | |
|
378 |
defect := aTestCaseName. |
|
379 |
testCase := allDefects at: aTestCaseName ifAbsent: [nil]. |
|
380 |
testCase isNil ifTrue: [^self enableDebugButton value: false]. |
|
381 |
self enableDebugButton value: true. |
|
382 |
self displayMode: 'Debugging'. |
|
383 |
(result isFailure: testCase) |
|
384 |
ifTrue: [testCase debugAsFailure] |
|
385 |
ifFalse: [testCase debug] |
|
386 |
||
387 |
"Modified: / 21.6.2000 / 12:12:09 / Sames" |
|
388 |
! |
|
389 |
||
390 |
enableDebugButton |
|
391 |
"automatically generated by UIPainter ..." |
|
392 |
"*** the code below creates a default model when invoked." |
|
393 |
"*** (which may not be the one you wanted)" |
|
394 |
"*** Please change as required and accept it in the browser." |
|
395 |
||
396 |
| holder | |
|
397 |
(holder := builder bindingAt: #enableDebugButton) isNil |
|
398 |
ifTrue: |
|
399 |
[holder := true asValue. |
|
400 |
builder aspectAt: #enableDebugButton put: holder |
|
401 |
" holder addDependent:self."]. |
|
402 |
^holder |
|
403 |
||
404 |
"Created: / 21.6.2000 / 10:47:34 / Sames" |
|
405 |
"Modified: / 21.6.2000 / 10:51:07 / Sames" |
|
406 |
! |
|
407 |
||
408 |
enableDefectsList |
|
409 |
"automatically generated by UIPainter ..." |
|
410 |
||
411 |
"*** the code below creates a default model when invoked." |
|
412 |
"*** (which may not be the one you wanted)" |
|
413 |
"*** Please change as required and accept it in the browser." |
|
414 |
||
415 |
|holder| |
|
416 |
||
417 |
(holder := builder bindingAt:#enableDefectsList) isNil ifTrue:[ |
|
418 |
holder := true asValue. |
|
419 |
builder aspectAt:#enableDefectsList put:holder. |
|
420 |
"/ holder addDependent:self. |
|
421 |
]. |
|
422 |
^ holder. |
|
423 |
||
424 |
"Created: / 21.6.2000 / 10:47:34 / Sames" |
|
425 |
! |
|
426 |
||
427 |
enableRunButton |
|
428 |
"automatically generated by UIPainter ..." |
|
429 |
||
430 |
"*** the code below creates a default model when invoked." |
|
431 |
"*** (which may not be the one you wanted)" |
|
432 |
"*** Please change as required and accept it in the browser." |
|
433 |
||
434 |
|holder| |
|
435 |
||
436 |
(holder := builder bindingAt:#enableRunButton) isNil ifTrue:[ |
|
437 |
holder := true asValue. |
|
438 |
builder aspectAt:#enableRunButton put:holder. |
|
439 |
"/ holder addDependent:self. |
|
440 |
]. |
|
441 |
^ holder. |
|
442 |
||
443 |
"Created: / 21.6.2000 / 10:47:34 / Sames" |
|
444 |
! |
|
445 |
||
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
446 |
enableRunDefectsButton |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
447 |
"automatically generated by UIPainter ..." |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
448 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
449 |
"*** the code below creates a default model when invoked." |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
450 |
"*** (which may not be the one you wanted)" |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
451 |
"*** Please change as required and accept it in the browser." |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
452 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
453 |
|holder| |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
454 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
455 |
(holder := builder bindingAt:#enableRunDefectsButton) isNil ifTrue:[ |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
456 |
holder := true asValue. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
457 |
builder aspectAt:#enableRunDefectsButton put:holder. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
458 |
"/ holder addDependent:self. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
459 |
]. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
460 |
^ holder. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
461 |
! |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
462 |
|
0 | 463 |
refreshSuites |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
464 |
self scriptModel value: (TestCase allSubclasses collect: [:each | each name]). |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
465 |
self script value:nil. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
466 |
self tests selection: 0. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
467 |
self defects selection: 0. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
468 |
result := TestResult new. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
469 |
self displayRefresh |
0 | 470 |
|
471 |
"Created: / 21.6.2000 / 10:58:34 / Sames" |
|
472 |
"Modified: / 21.6.2000 / 12:19:54 / Sames" |
|
473 |
! |
|
474 |
||
475 |
runAllTests |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
476 |
self runSuite: self allTestSuite |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
477 |
! |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
478 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
479 |
runDefectTests |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
480 |
| testSuite | |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
481 |
(testSuite := self defectTestSuite) notNil ifTrue: |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
482 |
[self runSuite: testSuite] |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
483 |
! |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
484 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
485 |
runDefects |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
486 |
allDefects size > 0 ifTrue:[ |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
487 |
^ self runDefectTests |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
488 |
]. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
489 |
self runTests |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
490 |
! |
0 | 491 |
|
492 |
runSuite: aTestSuite |
|
19 | 493 |
|numTests| |
494 |
||
495 |
numTests := 0. |
|
20 | 496 |
aTestSuite tests do:[:eachTestOrSubSuite | |
497 |
(eachTestOrSubSuite isKindOf:TestSuite) ifTrue:[ |
|
498 |
numTests := numTests + eachTestOrSubSuite tests size. |
|
499 |
] ifFalse:[ |
|
500 |
numTests := numTests + 1. |
|
501 |
] |
|
19 | 502 |
]. |
503 |
numberOfTestsToRun := numTests. |
|
504 |
self percentageDone value:0. |
|
505 |
||
506 |
Cursor wait |
|
507 |
showWhile: |
|
508 |
[self displayRunning. |
|
509 |
aTestSuite addDependentToHierachy: self. |
|
510 |
result := TestResult new. |
|
511 |
self percentageIndicatorVisible value:true. |
|
512 |
[aTestSuite run:result] |
|
513 |
ensure: [aTestSuite removeDependentFromHierachy: self. |
|
514 |
self percentageIndicatorVisible value:false. |
|
515 |
]. |
|
516 |
self updateWindow] |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
517 |
! |
0 | 518 |
|
519 |
runTests |
|
520 |
| testSuite | |
|
521 |
(testSuite := self freshTestSuite) notNil ifTrue: |
|
522 |
[self runSuite: testSuite] |
|
523 |
||
524 |
"Modified: / 2.4.2000 / 14:16:10 / Sames" |
|
525 |
! |
|
526 |
||
11 | 527 |
scriptSelectionChanged |
15 | 528 |
self enableRunButton value:(self script value notNil). |
11 | 529 |
! |
530 |
||
0 | 531 |
selection: aValue |
532 |
||
533 |
self debugTest: aValue |
|
534 |
||
535 |
"Created: / 4.4.2000 / 18:54:09 / Sames" |
|
536 |
"Modified: / 4.4.2000 / 19:01:33 / Sames" |
|
537 |
! |
|
538 |
||
539 |
suiteSelectionChanged |
|
8 | 540 |
|ok className description cls| |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
541 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
542 |
self enableRunButton value:(ok := self freshTestSuite notNil). |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
543 |
self enableRunDefectsButton value:(ok and:[allDefects size > 0]). |
0 | 544 |
|
8 | 545 |
self script value notNil ifTrue:[ |
546 |
className := self scriptModel value at:(self script value) ifAbsent:nil. |
|
547 |
(ok and:[className notNil]) ifTrue:[ |
|
548 |
cls := Smalltalk at:className. |
|
17 | 549 |
(cls class implements:#description) ifTrue:[ |
550 |
description := cls description. |
|
8 | 551 |
] |
552 |
]. |
|
553 |
]. |
|
17 | 554 |
self displayDetails:nil. |
555 |
self displayMode: (description ? ''). |
|
556 |
self displayGray. |
|
8 | 557 |
|
0 | 558 |
"Created: / 21.6.2000 / 11:31:25 / Sames" |
559 |
"Modified: / 21.6.2000 / 11:32:54 / Sames" |
|
560 |
! ! |
|
561 |
||
562 |
!TestRunner methodsFor:'Private'! |
|
563 |
||
564 |
allTestSuite |
|
565 |
| tokens stream | |
|
566 |
tokens := (TestCase subclasses collect: [:each | each name , '* ']) |
|
567 |
copyWithout: 'SUnitTest* '. |
|
568 |
stream := WriteStream on: String new. |
|
569 |
tokens do: [:each | stream nextPutAll: each]. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
570 |
^TestSuitesScripter run: stream contents |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
571 |
! |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
572 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
573 |
defectTestSuite |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
574 |
|suite| |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
575 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
576 |
suite := TestSuite new. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
577 |
allDefects keysAndValuesDo:[:nm :test | |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
578 |
suite addTest:test. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
579 |
]. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
580 |
^suite |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
581 |
|
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
582 |
! |
0 | 583 |
|
584 |
formatTime: aTime |
|
585 |
aTime hours > 0 ifTrue: [^aTime hours printString , 'h']. |
|
586 |
aTime minutes > 0 ifTrue: [^aTime minutes printString , 'min']. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
587 |
^aTime seconds printString , ' sec' |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
588 |
! |
0 | 589 |
|
590 |
freshTestSuite |
|
591 |
||
592 |
^TestSuitesScripter run: self tests contents |
|
593 |
||
594 |
"Modified: / 4.4.2000 / 20:13:41 / Sames" |
|
595 |
! |
|
596 |
||
597 |
postOpenWith: aBuilder |
|
598 |
"automatically generated by UIPainter ..." |
|
599 |
||
600 |
super postOpenWith: aBuilder. |
|
601 |
self tests defaultLabel: ''. |
|
11 | 602 |
"/ self tests selection: 'ExampleSetTest'. self script value:1. |
15 | 603 |
|
604 |
self enableRunButton value: (self script value notNil). |
|
10 | 605 |
self enableRunDefectsButton value: false. |
0 | 606 |
self enableDebugButton value: false. |
607 |
self enableDefectsList value: false. |
|
608 |
self script onChangeSend: #suiteSelectionChanged to: self |
|
609 |
||
610 |
"Created: / 2.4.2000 / 14:44:32 / Sames" |
|
611 |
"Modified: / 21.6.2000 / 12:06:30 / Sames" |
|
612 |
! |
|
613 |
||
614 |
timeSinceLastPassAsString |
|
615 |
lastPass isNil ifTrue: [^'']. |
|
616 |
^', ' , (self formatTime: (Time now subtractTime: lastPass getSeconds)) , ' since last Pass' |
|
617 |
||
618 |
"Modified: / 3.4.2000 / 19:17:11 / Sames" |
|
619 |
! ! |
|
620 |
||
621 |
!TestRunner methodsFor:'Updating'! |
|
622 |
||
623 |
displayColor: aColorValue |
|
624 |
||
625 |
(builder componentAt: #mode) widget insideColor: aColorValue. |
|
626 |
(builder componentAt: #details) widget insideColor: aColorValue. |
|
627 |
||
628 |
"Modified: / 2.4.2000 / 14:21:42 / Sames" |
|
629 |
! |
|
630 |
||
631 |
displayDefault |
|
632 |
self displayColor: self tests backgroundColor |
|
633 |
||
634 |
"Created: / 21.6.2000 / 12:28:06 / Sames" |
|
635 |
"Modified: / 21.6.2000 / 12:35:09 / Sames" |
|
636 |
! |
|
637 |
||
638 |
displayDefects: aCollection |
|
639 |
| menuButton | |
|
640 |
menuButton := self builder componentAt: #defects. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
641 |
aCollection isEmpty ifTrue: [ |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
642 |
menuButton disable. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
643 |
self enableRunDefectsButton value:false. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
644 |
^ self |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
645 |
]. |
0 | 646 |
allDefects := Dictionary new. |
647 |
aCollection do: [:each | allDefects at: each printString put: each]. |
|
648 |
self defectMenu value: allDefects keys asOrderedCollection. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
649 |
menuButton enable. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
650 |
self enableRunDefectsButton value:(allDefects size > 0). |
0 | 651 |
|
652 |
"Modified: / 4.4.2000 / 20:11:06 / Sames" |
|
653 |
! |
|
654 |
||
655 |
displayDetails: aString |
|
19 | 656 |
self details value: aString. |
657 |
self windowGroup repairDamage. |
|
0 | 658 |
|
659 |
"Modified: / 21.6.2000 / 11:10:14 / Sames" |
|
660 |
! |
|
661 |
||
662 |
displayFail |
|
663 |
self displayRed. |
|
664 |
self displayMode: 'Fail'. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
665 |
self displayDetails: result printString. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
666 |
! |
0 | 667 |
|
17 | 668 |
displayGray |
669 |
self displayColor: (View defaultViewBackgroundColor) |
|
670 |
! |
|
671 |
||
0 | 672 |
displayGreen |
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
673 |
self displayColor: ColorValue green |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
674 |
! |
0 | 675 |
|
676 |
displayMode: aString |
|
677 |
self mode value: aString |
|
678 |
||
679 |
"Modified: / 21.6.2000 / 11:14:19 / Sames" |
|
680 |
! |
|
681 |
||
682 |
displayPass |
|
683 |
self displayMode: 'Pass'. |
|
684 |
self displayDetails: result runCount printString , ' run' , self timeSinceLastPassAsString. |
|
685 |
self displayGreen. |
|
686 |
lastPass := Time now |
|
687 |
||
688 |
"Modified: / 21.6.2000 / 12:14:52 / Sames" |
|
689 |
! |
|
690 |
||
691 |
displayRed |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
692 |
self displayColor: ColorValue red. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
693 |
! |
0 | 694 |
|
695 |
displayRefresh |
|
696 |
self displayMode: 'N/A'. |
|
697 |
self displayDetails:'...'. |
|
698 |
self updateDefects. |
|
699 |
self enableRunButton value: false. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
700 |
self enableRunDefectsButton value: false. |
0 | 701 |
self enableDebugButton value: false. |
702 |
self displayDefault |
|
703 |
||
704 |
"Created: / 21.6.2000 / 12:14:11 / Sames" |
|
705 |
"Modified: / 21.6.2000 / 12:28:24 / Sames" |
|
706 |
! |
|
707 |
||
708 |
displayRunning |
|
709 |
self displayYellow. |
|
710 |
self displayMode: 'running'. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
711 |
self displayDetails: '...'. |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
712 |
! |
0 | 713 |
|
714 |
displayYellow |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
715 |
self displayColor: ColorValue yellow |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
716 |
! |
0 | 717 |
|
718 |
update: anObject |
|
19 | 719 |
(anObject isKindOf: TestCase) |
720 |
ifTrue: [ |
|
721 |
self percentageDone value:(result runCount / numberOfTestsToRun * 100) rounded. |
|
722 |
self displayDetails: anObject printString |
|
723 |
] |
|
724 |
ifFalse: [super update: anObject] |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
725 |
! |
0 | 726 |
|
727 |
updateDefects |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
728 |
self displayDefects: result defects |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
729 |
! |
0 | 730 |
|
731 |
updateWindow |
|
732 |
result hasPassed |
|
733 |
ifTrue: [self displayPass] |
|
734 |
ifFalse: [self displayFail]. |
|
6
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
735 |
self updateDefects |
78bb1397e43d
added rerun-defect tests; fixed button enable bug
Claus Gittinger <cg@exept.de>
parents:
5
diff
changeset
|
736 |
! ! |
0 | 737 |
|
11 | 738 |
!TestRunner class methodsFor:'documentation'! |
739 |
||
740 |
version |
|
20 | 741 |
^ '$Header: /cvs/stx/stx/goodies/sunit/TestRunner.st,v 1.11 2001-01-11 16:00:24 cg Exp $' |
11 | 742 |
! ! |