author | Jan Vrany <jan.vrany@labware.com> |
Wed, 08 Mar 2023 16:40:41 +0000 | |
branch | jv |
changeset 19643 | b3148ab32c03 |
parent 18226 | 346376844040 |
child 19649 | 9d4bb6087b15 |
permissions | -rw-r--r-- |
15950 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
18226 | 3 |
COPYRIGHT (c) 2017 Jan Vrany |
15950 | 4 |
All Rights Reserved |
17764
7ecdf78ebe2d
Mini / Embedded test runner: remove (hide) "Coverage" and "Run all" buttons from embedded / mini test runner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17136
diff
changeset
|
5 |
|
15950 | 6 |
This software is furnished under a license and may be used |
7 |
only in accordance with the terms of that license and with the |
|
8 |
inclusion of the above copyright notice. This software may not |
|
9 |
be provided or otherwise made available to, or used by, any |
|
10 |
other person. No title to or ownership of the software is |
|
11 |
hereby transferred. |
|
12 |
" |
|
9954 | 13 |
"{ Package: 'stx:libtool' }" |
14 |
||
15 |
"{ NameSpace: Tools }" |
|
16 |
||
14729
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
17 |
TestRunnerMini subclass:#TestRunnerEmbedded |
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
18 |
instanceVariableNames:'' |
10647
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
19 |
classVariableNames:'' |
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
20 |
poolDictionaries:'' |
1e9912f9a0d8
Embedded test runner no longer reuse old testcase instances
vrany
parents:
10608
diff
changeset
|
21 |
category:'SUnit-UI' |
9954 | 22 |
! |
23 |
||
15950 | 24 |
!TestRunnerEmbedded class methodsFor:'documentation'! |
25 |
||
26 |
copyright |
|
27 |
" |
|
28 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
18226 | 29 |
COPYRIGHT (c) 2017 Jan Vrany |
15950 | 30 |
All Rights Reserved |
31 |
||
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
! ! |
|
9954 | 40 |
|
41 |
!TestRunnerEmbedded class methodsFor:'plugIn spec'! |
|
42 |
||
43 |
aspectSelectors |
|
44 |
"This resource specification was automatically generated |
|
45 |
by the UIPainter of ST/X." |
|
46 |
||
47 |
"Do not manually edit this. If it is corrupted, |
|
48 |
the UIPainter may not be able to read the specification." |
|
49 |
||
50 |
"Return a description of exported aspects; |
|
51 |
these can be connected to aspects of an embedding application |
|
52 |
(if this app is embedded in a subCanvas)." |
|
53 |
||
54 |
^ #( |
|
55 |
#methodGeneratorHolder |
|
56 |
#selectedClassesHolder |
|
57 |
#selectedMethodsHolder |
|
58 |
#selectedProtocolsHolder |
|
59 |
). |
|
60 |
||
61 |
! ! |
|
62 |
||
63 |
!TestRunnerEmbedded methodsFor:'aspects'! |
|
64 |
||
65 |
methodGeneratorHolder |
|
66 |
"return/create the 'methodGeneratorHolder' value holder (automatically generated)" |
|
67 |
||
68 |
methodGeneratorHolder isNil ifTrue:[ |
|
69 |
methodGeneratorHolder := ValueHolder new. |
|
70 |
methodGeneratorHolder addDependent:self. |
|
71 |
]. |
|
72 |
^ methodGeneratorHolder |
|
73 |
! |
|
74 |
||
75 |
methodGeneratorHolder:something |
|
76 |
"set the 'methodGeneratorHolder' value holder (automatically generated)" |
|
77 |
||
78 |
|oldValue newValue| |
|
79 |
||
80 |
methodGeneratorHolder notNil ifTrue:[ |
|
81 |
oldValue := methodGeneratorHolder value. |
|
82 |
methodGeneratorHolder removeDependent:self. |
|
83 |
]. |
|
84 |
methodGeneratorHolder := something. |
|
85 |
methodGeneratorHolder notNil ifTrue:[ |
|
86 |
methodGeneratorHolder addDependent:self. |
|
87 |
]. |
|
88 |
newValue := methodGeneratorHolder value. |
|
89 |
oldValue ~~ newValue ifTrue:[ |
|
90 |
self update:#value with:newValue from:methodGeneratorHolder. |
|
91 |
]. |
|
92 |
! |
|
93 |
||
94 |
selectedClassesHolder |
|
95 |
"return/create the 'selectedClassesHolder' value holder (automatically generated)" |
|
96 |
||
97 |
selectedClassesHolder isNil ifTrue:[ |
|
98 |
selectedClassesHolder := ValueHolder new. |
|
99 |
selectedClassesHolder addDependent:self. |
|
100 |
]. |
|
101 |
^ selectedClassesHolder |
|
102 |
! |
|
103 |
||
104 |
selectedClassesHolder:something |
|
105 |
"set the 'selectedClassesHolder' value holder (automatically generated)" |
|
106 |
||
107 |
|oldValue newValue| |
|
108 |
||
109 |
selectedClassesHolder notNil ifTrue:[ |
|
110 |
oldValue := selectedClassesHolder value. |
|
111 |
selectedClassesHolder removeDependent:self. |
|
112 |
]. |
|
113 |
selectedClassesHolder := something. |
|
114 |
selectedClassesHolder notNil ifTrue:[ |
|
115 |
selectedClassesHolder addDependent:self. |
|
116 |
]. |
|
117 |
newValue := selectedClassesHolder value. |
|
118 |
oldValue ~~ newValue ifTrue:[ |
|
119 |
self update:#value with:newValue from:selectedClassesHolder. |
|
120 |
]. |
|
121 |
! |
|
122 |
||
123 |
selectedMethodsHolder |
|
124 |
"return/create the 'selectedMethodsHolder' value holder (automatically generated)" |
|
125 |
||
126 |
selectedMethodsHolder isNil ifTrue:[ |
|
127 |
selectedMethodsHolder := ValueHolder new. |
|
128 |
selectedMethodsHolder addDependent:self. |
|
129 |
]. |
|
130 |
^ selectedMethodsHolder |
|
131 |
! |
|
132 |
||
133 |
selectedMethodsHolder:something |
|
134 |
"set the 'selectedMethodsHolder' value holder (automatically generated)" |
|
135 |
||
136 |
|oldValue newValue| |
|
137 |
||
138 |
selectedMethodsHolder notNil ifTrue:[ |
|
139 |
oldValue := selectedMethodsHolder value. |
|
140 |
selectedMethodsHolder removeDependent:self. |
|
141 |
]. |
|
142 |
selectedMethodsHolder := something. |
|
143 |
selectedMethodsHolder notNil ifTrue:[ |
|
144 |
selectedMethodsHolder addDependent:self. |
|
145 |
]. |
|
146 |
newValue := selectedMethodsHolder value. |
|
147 |
oldValue ~~ newValue ifTrue:[ |
|
148 |
self update:#value with:newValue from:selectedMethodsHolder. |
|
149 |
]. |
|
150 |
! |
|
151 |
||
152 |
selectedProtocolsHolder |
|
153 |
"return/create the 'selectedProtocolsHolder' value holder (automatically generated)" |
|
154 |
||
155 |
selectedProtocolsHolder isNil ifTrue:[ |
|
156 |
selectedProtocolsHolder := ValueHolder new. |
|
157 |
selectedProtocolsHolder addDependent:self. |
|
158 |
]. |
|
159 |
^ selectedProtocolsHolder |
|
160 |
! |
|
161 |
||
162 |
selectedProtocolsHolder:something |
|
163 |
"set the 'selectedProtocolsHolder' value holder (automatically generated)" |
|
164 |
||
165 |
|oldValue newValue| |
|
166 |
||
167 |
selectedProtocolsHolder notNil ifTrue:[ |
|
168 |
oldValue := selectedProtocolsHolder value. |
|
169 |
selectedProtocolsHolder removeDependent:self. |
|
170 |
]. |
|
171 |
selectedProtocolsHolder := something. |
|
172 |
selectedProtocolsHolder notNil ifTrue:[ |
|
173 |
selectedProtocolsHolder addDependent:self. |
|
174 |
]. |
|
175 |
newValue := selectedProtocolsHolder value. |
|
176 |
oldValue ~~ newValue ifTrue:[ |
|
177 |
self update:#value with:newValue from:selectedProtocolsHolder. |
|
178 |
]. |
|
14729
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
179 |
! ! |
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
180 |
|
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
181 |
!TestRunnerEmbedded methodsFor:'aspects-visibility'! |
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
182 |
|
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
183 |
pinButtonVisibleHolder |
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
184 |
^ true |
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
185 |
|
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
186 |
"Created: / 23-09-2014 / 10:11:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11552 | 187 |
! |
188 |
||
14729
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
189 |
runAllButtonVisibleHolder |
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
190 |
^ true |
11552 | 191 |
|
14729
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
192 |
"Created: / 23-09-2014 / 10:12:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17764
7ecdf78ebe2d
Mini / Embedded test runner: remove (hide) "Coverage" and "Run all" buttons from embedded / mini test runner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17136
diff
changeset
|
193 |
"Modified: / 17-11-2017 / 11:44:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
14729
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
194 |
! |
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
195 |
|
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
196 |
runFailedButtonVisibleHolder |
17764
7ecdf78ebe2d
Mini / Embedded test runner: remove (hide) "Coverage" and "Run all" buttons from embedded / mini test runner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17136
diff
changeset
|
197 |
^ false "/true |
14729
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
198 |
|
d33037b4c843
Most of the code moved to superclass (Tools::TestRunnerMini), UI changed a bit.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14727
diff
changeset
|
199 |
"Created: / 23-09-2014 / 10:12:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17764
7ecdf78ebe2d
Mini / Embedded test runner: remove (hide) "Coverage" and "Run all" buttons from embedded / mini test runner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17136
diff
changeset
|
200 |
"Modified: / 17-11-2017 / 11:43:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9954 | 201 |
! ! |
202 |
||
203 |
!TestRunnerEmbedded methodsFor:'change & update'! |
|
204 |
||
14740
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
205 |
invalidateTestCases |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
206 |
allTestCases := nil. |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
207 |
! |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
208 |
|
9954 | 209 |
update:aspect with:param from: sender |
210 |
"Invoked when an object that I depend upon sends a change notification." |
|
211 |
||
15442
4068936bef58
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
15066
diff
changeset
|
212 |
sender == selectedMethodsHolder ifTrue:[ |
4068936bef58
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
15066
diff
changeset
|
213 |
self enqueueMessage:#updateTestCases for:self arguments:#(). |
4068936bef58
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
15066
diff
changeset
|
214 |
self enqueueMessage:#updateSuiteAndResult for:self arguments:#(). |
4068936bef58
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
15066
diff
changeset
|
215 |
]. |
4068936bef58
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
15066
diff
changeset
|
216 |
|
9954 | 217 |
sender == selectedClassesHolder ifTrue:[ |
218 |
self |
|
11966
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
219 |
invalidateTestCases; "/ updateTestSuite; |
6040753eab24
asynchronous update of testSuite and suiteAndResult
Claus Gittinger <cg@exept.de>
parents:
11925
diff
changeset
|
220 |
invalidateSuiteAndResult; "/ updateTestSuiteAndResult; |
9954 | 221 |
updateVisibility. |
15442
4068936bef58
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
15066
diff
changeset
|
222 |
|
12762
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
223 |
self hasTestCaseSelected ifTrue:[ |
15066
882a4c0b78e5
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
14740
diff
changeset
|
224 |
self enqueueMessage:#updateTestCases for:self arguments:#(). |
882a4c0b78e5
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
14740
diff
changeset
|
225 |
self enqueueMessage:#updateSuiteAndResult for:self arguments:#(). |
882a4c0b78e5
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
14740
diff
changeset
|
226 |
"/ self enqueueDelayedAction:[ self updateTestCases; updateSuiteAndResult ]. |
12762
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
227 |
]. |
9954 | 228 |
^ self. |
229 |
]. |
|
12762
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
230 |
self hasTestCaseSelected ifTrue:[ |
15066
882a4c0b78e5
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
14740
diff
changeset
|
231 |
(sender == selectedProtocolsHolder |
882a4c0b78e5
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
14740
diff
changeset
|
232 |
or:[ sender == selectedMethodsHolder |
882a4c0b78e5
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
14740
diff
changeset
|
233 |
or:[ sender == methodGeneratorHolder ]]) ifTrue:[ |
12762
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
234 |
self invalidateSuiteAndResult. |
15066
882a4c0b78e5
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
14740
diff
changeset
|
235 |
self enqueueMessage:#updateSuiteAndResult for:self arguments:#(). |
12762
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
236 |
^self |
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
237 |
]. |
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
238 |
|
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
239 |
sender == Smalltalk ifTrue:[ |
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
240 |
aspect == #lastTestRunResult ifTrue:[ |
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
241 |
allTestCases notNil ifTrue:[ |
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
242 |
(allTestCases includesIdentical: param first) ifTrue:[ |
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
243 |
self invalidateSuiteAndResult. "/ updateTestSuiteAndResult. |
15066
882a4c0b78e5
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
14740
diff
changeset
|
244 |
self enqueueMessage:#updateSuiteAndResult for:self arguments:#(). |
12762
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
245 |
^self |
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
246 |
] |
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
247 |
]. |
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
248 |
] |
eeb5359c60d3
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12604
diff
changeset
|
249 |
]. |
9954 | 250 |
]. |
251 |
||
252 |
super update:aspect with:param from: sender |
|
253 |
||
10886
8619db59aff4
bug fix in: #update:with:from: (selectedTestCases ivar might be nil)
vrany
parents:
10862
diff
changeset
|
254 |
"Modified: / 20-11-2011 / 12:40:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11552 | 255 |
"Modified: / 04-06-2012 / 19:03:34 / cg" |
14740
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
256 |
! |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
257 |
|
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
258 |
updateTestCases |
15462
3ecc5183f23a
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
15442
diff
changeset
|
259 |
|classes| |
3ecc5183f23a
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
15442
diff
changeset
|
260 |
|
3ecc5183f23a
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
15442
diff
changeset
|
261 |
classes := (self selectedClassesHolder value ? #()) |
3ecc5183f23a
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
15442
diff
changeset
|
262 |
select:[:cls | self isTestCaseLike:cls ] as:Set. |
3ecc5183f23a
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
15442
diff
changeset
|
263 |
classes addAll:((self selectedMethodsHolder value ? #()) |
3ecc5183f23a
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
15442
diff
changeset
|
264 |
collect:[:mthd | mthd mclass ] |
3ecc5183f23a
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
15442
diff
changeset
|
265 |
thenSelect:[:cls | self isTestCaseLike:cls ]). |
16997 | 266 |
allTestCases := classes asArray. |
267 |
allTestCases sortBySelector:#name. |
|
14740
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
268 |
|
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
269 |
"Created: / 11-03-2010 / 10:31:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
270 |
"Modified: / 24-01-2012 / 22:09:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
271 |
"Modified: / 04-06-2012 / 19:02:52 / cg" |
9954 | 272 |
! ! |
273 |
||
274 |
!TestRunnerEmbedded methodsFor:'private'! |
|
275 |
||
276 |
hide |
|
277 |
||
278 |
self visibility: false height: 0 |
|
279 |
||
280 |
"Created: / 11-03-2010 / 09:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
281 |
! |
|
282 |
||
283 |
show |
|
284 |
||
285 |
self visibility: true height: 50 |
|
286 |
||
287 |
"Created: / 11-03-2010 / 09:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
288 |
! |
|
289 |
||
10564
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
290 |
visibility:visibility height:height |
14727
3c8f4e917e89
Support for detaching embedded test runner to separate, top level tool-like window.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14322
diff
changeset
|
291 |
| window container list h| |
9954 | 292 |
|
14727
3c8f4e917e89
Support for detaching embedded test runner to separate, top level tool-like window.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14322
diff
changeset
|
293 |
window := self window. |
3c8f4e917e89
Support for detaching embedded test runner to separate, top level tool-like window.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14322
diff
changeset
|
294 |
window isNil ifTrue:[ ^ self ]. |
3c8f4e917e89
Support for detaching embedded test runner to separate, top level tool-like window.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14322
diff
changeset
|
295 |
container := self window container. |
3c8f4e917e89
Support for detaching embedded test runner to separate, top level tool-like window.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14322
diff
changeset
|
296 |
container isNil ifTrue:[ ^ self ]. |
14322
b742f9db3ddd
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
13847
diff
changeset
|
297 |
|
10564
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
298 |
h := visibility ifFalse:[0] ifTrue:[ height ]. |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
299 |
container isVisible == visibility ifFalse:[ |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
300 |
container isVisible:visibility |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
301 |
]. |
14322
b742f9db3ddd
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
13847
diff
changeset
|
302 |
"/ this is the kind of dangerous access which breaks, whenever some wrapping setup |
b742f9db3ddd
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
13847
diff
changeset
|
303 |
"/ changes. Never do this!!!!!!!! |
b742f9db3ddd
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
13847
diff
changeset
|
304 |
"/ I'd rather see code which refers to the widget by name, |
b742f9db3ddd
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
13847
diff
changeset
|
305 |
"/ or if there is an explicit setter for the container, from which to steal the space. |
9954 | 306 |
list := container container subViews first. |
10564
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
307 |
(list layout bottomOffset ~= height negated) ifTrue:[ |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
308 |
list layout:((list layout) |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
309 |
bottomOffset:height negated; |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
310 |
yourself) |
4e109c7b8ee8
comment/format in: #visibility:height:
Claus Gittinger <cg@exept.de>
parents:
10563
diff
changeset
|
311 |
]. |
9954 | 312 |
|
313 |
"Created: / 11-03-2010 / 09:51:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
14727
3c8f4e917e89
Support for detaching embedded test runner to separate, top level tool-like window.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14322
diff
changeset
|
314 |
"Modified: / 22-09-2014 / 13:47:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9954 | 315 |
! ! |
316 |
||
14740
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
317 |
!TestRunnerEmbedded methodsFor:'utilities'! |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
318 |
|
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
319 |
suiteForRun |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
320 |
"if methods are selected, a suite for those methods is built and returned. |
15477
b628707db922
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
15462
diff
changeset
|
321 |
If protocols are selected, a suite for all methods in those protocols |
14740
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
322 |
is built and returned. |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
323 |
Otherwise, a suite for all methods in the class is built and returned" |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
324 |
|
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
325 |
| testMethods protocols suite selectedClass | |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
326 |
|
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
327 |
selectedClass := self theSingleTestCase. |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
328 |
selectedMethodsHolder value notEmptyOrNil ifTrue:[ |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
329 |
testMethods := self selectedTestMethods. |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
330 |
suite := TestSuite named:(self suiteNameFromMethods:testMethods). |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
331 |
testMethods do:[:mthd | |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
332 |
| class selector | |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
333 |
|
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
334 |
class := selectedClass isNil ifTrue:[mthd mclass] ifFalse:[ selectedClass ]. |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
335 |
suite addTest:(class asTestCase selector:mthd selector) |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
336 |
]. |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
337 |
^ suite |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
338 |
]. |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
339 |
(protocols := selectedProtocolsHolder value) notEmptyOrNil ifTrue:[ |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
340 |
suite := TestSuite named:(self suiteNameFromProtocols:protocols). |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
341 |
(self selectedTestMethodsFromProtocols:protocols inClass:selectedClass) do:[:mthd | |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
342 |
| class selector | |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
343 |
|
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
344 |
class := selectedClass isNil ifTrue:[mthd mclass] ifFalse:[ selectedClass ]. |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
345 |
suite addTest:(class asTestCase selector:mthd selector) |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
346 |
]. |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
347 |
^ suite |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
348 |
]. |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
349 |
^ self suiteForRunAll |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
350 |
|
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
351 |
"Created: / 15-03-2010 / 13:13:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
352 |
"Modified: / 04-08-2011 / 19:06:42 / cg" |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
353 |
"Modified (format): / 23-09-2014 / 10:19:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
354 |
! |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
355 |
|
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
356 |
suiteForRunAll |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
357 |
|suite| |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
358 |
|
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
359 |
allTestCases isNil ifTrue:[ |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
360 |
self updateTestCases. |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
361 |
]. |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
362 |
suite := TestSuite named:(self suiteNameFromClasses: self allTestCases). |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
363 |
|
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
364 |
allTestCases do:[:testCase | |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
365 |
suite addTests:(self buildSuiteFromClass:testCase) tests |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
366 |
]. |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
367 |
^suite |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
368 |
|
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
369 |
"Modified: / 04-03-2011 / 06:57:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
370 |
"Modified: / 04-06-2012 / 19:01:48 / cg" |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
371 |
! ! |
920b279e215c
Oops, fixes after refactoring.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14729
diff
changeset
|
372 |
|
9954 | 373 |
!TestRunnerEmbedded class methodsFor:'documentation'! |
374 |
||
10432 | 375 |
version |
16997 | 376 |
^ '$Header$' |
10432 | 377 |
! |
378 |
||
9954 | 379 |
version_CVS |
16997 | 380 |
^ '$Header$' |
17764
7ecdf78ebe2d
Mini / Embedded test runner: remove (hide) "Coverage" and "Run all" buttons from embedded / mini test runner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17136
diff
changeset
|
381 |
! |
7ecdf78ebe2d
Mini / Embedded test runner: remove (hide) "Coverage" and "Run all" buttons from embedded / mini test runner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17136
diff
changeset
|
382 |
|
7ecdf78ebe2d
Mini / Embedded test runner: remove (hide) "Coverage" and "Run all" buttons from embedded / mini test runner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17136
diff
changeset
|
383 |
version_HG |
7ecdf78ebe2d
Mini / Embedded test runner: remove (hide) "Coverage" and "Run all" buttons from embedded / mini test runner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17136
diff
changeset
|
384 |
|
7ecdf78ebe2d
Mini / Embedded test runner: remove (hide) "Coverage" and "Run all" buttons from embedded / mini test runner
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17136
diff
changeset
|
385 |
^ '$Changeset: <not expanded> $' |
9954 | 386 |
! ! |
12604
8d8912ec9551
class: Tools::TestRunnerEmbedded
Claus Gittinger <cg@exept.de>
parents:
12055
diff
changeset
|
387 |