author | Jan Vrany <jan.vrany@labware.com> |
Mon, 20 Sep 2021 11:32:18 +0100 | |
branch | jv |
changeset 19612 | 9f2e3136aa4d |
parent 12807 | ba8c5416aa28 |
permissions | -rw-r--r-- |
9952 | 1 |
" |
10091 | 2 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
3 |
Copyright (c) 2009-2010 eXept Software AG |
|
19612
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
4 |
Copyright (c) 2021 LabWare |
9952 | 5 |
|
10091 | 6 |
Permission is hereby granted, free of charge, to any person |
7 |
obtaining a copy of this software and associated documentation |
|
8 |
files (the 'Software'), to deal in the Software without |
|
9 |
restriction, including without limitation the rights to use, |
|
10 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
11 |
copies of the Software, and to permit persons to whom the |
|
12 |
Software is furnished to do so, subject to the following |
|
13 |
conditions: |
|
14 |
||
15 |
The above copyright notice and this permission notice shall be |
|
16 |
included in all copies or substantial portions of the Software. |
|
17 |
||
18 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
19 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
20 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
21 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
22 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
23 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
24 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
25 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9952 | 26 |
" |
27 |
"{ Package: 'stx:libtool' }" |
|
28 |
||
10611 | 29 |
"{ NameSpace: Tools }" |
30 |
||
9952 | 31 |
ApplicationModel subclass:#AbstractTestRunner |
10611 | 32 |
instanceVariableNames:'' |
19612
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
33 |
classVariableNames:'' |
10611 | 34 |
poolDictionaries:'' |
35 |
category:'SUnit-UI' |
|
10604 | 36 |
! |
37 |
||
9952 | 38 |
!AbstractTestRunner class methodsFor:'documentation'! |
39 |
||
40 |
copyright |
|
41 |
" |
|
10091 | 42 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
43 |
Copyright (c) 2009-2010 eXept Software AG |
|
19612
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
44 |
Copyright (c) 2021 LabWare |
10091 | 45 |
|
46 |
Permission is hereby granted, free of charge, to any person |
|
47 |
obtaining a copy of this software and associated documentation |
|
48 |
files (the 'Software'), to deal in the Software without |
|
49 |
restriction, including without limitation the rights to use, |
|
50 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
51 |
copies of the Software, and to permit persons to whom the |
|
52 |
Software is furnished to do so, subject to the following |
|
53 |
conditions: |
|
9952 | 54 |
|
10091 | 55 |
The above copyright notice and this permission notice shall be |
56 |
included in all copies or substantial portions of the Software. |
|
57 |
||
58 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
59 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
60 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
61 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
62 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
63 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
64 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
65 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9952 | 66 |
" |
67 |
! ! |
|
68 |
||
19612
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
69 |
!AbstractTestRunner methodsFor:'accessing-look'! |
9952 | 70 |
|
19612
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
71 |
errorBackgroundColor |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
72 |
<resource: #style (#'testRunner.error.backgroundColor')> |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
73 |
|
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
74 |
^ self styleSheet |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
75 |
colorAt:#'testRunner.error.backgroundColor' |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
76 |
default:[ Color redByte:194 greenByte:110 blueByte:110 ] |
9952 | 77 |
|
19612
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
78 |
"Created: / 17-09-2021 / 22:20:02 / Jan Vrany <jan.vrany@labware.com>" |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
79 |
! |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
80 |
|
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
81 |
failedBackgroundColor |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
82 |
<resource: #style (#'testRunner.failed.backgroundColor')> |
9952 | 83 |
|
19612
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
84 |
^ self styleSheet |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
85 |
colorAt:#'testRunner.failed.backgroundColor' |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
86 |
default:[ Color redByte:194 greenByte:110 blueByte:110 ] |
9952 | 87 |
|
19612
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
88 |
"Created: / 17-09-2021 / 22:19:25 / Jan Vrany <jan.vrany@labware.com>" |
10167
32f3659ee1aa
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10091
diff
changeset
|
89 |
! |
32f3659ee1aa
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10091
diff
changeset
|
90 |
|
19612
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
91 |
notRunBackgroundColor |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
92 |
<resource: #style (#'testRunner.notrun.backgroundColor')> |
9952 | 93 |
|
19612
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
94 |
^ self styleSheet |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
95 |
colorAt:#'testRunner.notrun.backgroundColor' |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
96 |
default:[ Color redByte:145 greenByte:145 blueByte:145 ] |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
97 |
|
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
98 |
"Created: / 17-09-2021 / 22:20:58 / Jan Vrany <jan.vrany@labware.com>" |
9952 | 99 |
! |
100 |
||
19612
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
101 |
passedBackgroundColor |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
102 |
<resource: #style (#'testRunner.passed.backgroundColor')> |
9952 | 103 |
|
19612
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
104 |
^ self styleSheet |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
105 |
colorAt:#'testRunner.passed.backgroundColor' |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
106 |
default:[ Color redByte:92 greenByte:166 blueByte:92 ] |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
107 |
|
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
108 |
"Created: / 17-09-2021 / 22:18:56 / Jan Vrany <jan.vrany@labware.com>" |
9952 | 109 |
! |
110 |
||
19612
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
111 |
runningBackgroundColor |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
112 |
<resource: #style (#'testRunner.running.backgroundColor')> |
9952 | 113 |
|
19612
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
114 |
^ self styleSheet |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
115 |
colorAt:#'testRunner.running.backgroundColor' |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
116 |
default:[ self styleSheet |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
117 |
colorAt: #'progressIndicator.foregroundColor' |
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
118 |
default: [ Color blue ] ] |
9952 | 119 |
|
19612
9f2e3136aa4d
Themes: use stylesheet to define colors in `InlineMessageDialog` and test runners
Jan Vrany <jan.vrany@labware.com>
parents:
12807
diff
changeset
|
120 |
"Created: / 17-09-2021 / 22:22:32 / Jan Vrany <jan.vrany@labware.com>" |
9952 | 121 |
! ! |
122 |
||
123 |
!AbstractTestRunner methodsFor:'private'! |
|
124 |
||
125 |
buildSuiteFromClass:testCaseCls |
|
126 |
||
127 |
^testCaseCls asTestCase buildSuite |
|
128 |
||
129 |
"Modified: / 04-03-2011 / 08:22:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
130 |
! |
|
131 |
||
132 |
isTestCaseLike:cls |
|
133 |
||
134 |
^cls isTestCaseLike |
|
135 |
||
136 |
"Modified: / 28-02-2011 / 21:31:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
137 |
! ! |
|
138 |
||
139 |
!AbstractTestRunner methodsFor:'utilities'! |
|
140 |
||
141 |
suiteNameFromClasses: classes |
|
12763
37d514cde1d5
class: Tools::AbstractTestRunner
Claus Gittinger <cg@exept.de>
parents:
11849
diff
changeset
|
142 |
|numClasses| |
9952 | 143 |
|
12763
37d514cde1d5
class: Tools::AbstractTestRunner
Claus Gittinger <cg@exept.de>
parents:
11849
diff
changeset
|
144 |
(numClasses := classes size) == 1 ifTrue: |
9952 | 145 |
[^classes anyOne nameWithoutPrefix]. |
12763
37d514cde1d5
class: Tools::AbstractTestRunner
Claus Gittinger <cg@exept.de>
parents:
11849
diff
changeset
|
146 |
numClasses == 2 ifTrue: |
9952 | 147 |
[^String streamContents: |
148 |
[:s|classes |
|
149 |
do:[:cls|s nextPutAll: cls nameWithoutPrefix] |
|
150 |
separatedBy:[s nextPutAll:' & ']]]. |
|
151 |
||
12763
37d514cde1d5
class: Tools::AbstractTestRunner
Claus Gittinger <cg@exept.de>
parents:
11849
diff
changeset
|
152 |
^numClasses printString , ' test cases'. |
9952 | 153 |
|
154 |
"Created: / 15-03-2010 / 13:23:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
155 |
! |
|
156 |
||
157 |
suiteNameFromMethods: methods |
|
11849
d2f4dee8391f
changed: #suiteNameFromMethods:
Claus Gittinger <cg@exept.de>
parents:
10836
diff
changeset
|
158 |
|numMethods| |
9952 | 159 |
|
12763
37d514cde1d5
class: Tools::AbstractTestRunner
Claus Gittinger <cg@exept.de>
parents:
11849
diff
changeset
|
160 |
(numMethods := methods size) == 1 ifTrue:[^ methods anyOne selector]. |
37d514cde1d5
class: Tools::AbstractTestRunner
Claus Gittinger <cg@exept.de>
parents:
11849
diff
changeset
|
161 |
|
11849
d2f4dee8391f
changed: #suiteNameFromMethods:
Claus Gittinger <cg@exept.de>
parents:
10836
diff
changeset
|
162 |
^numMethods printString , ' tests from ' , |
d2f4dee8391f
changed: #suiteNameFromMethods:
Claus Gittinger <cg@exept.de>
parents:
10836
diff
changeset
|
163 |
(self suiteNameFromClasses: |
d2f4dee8391f
changed: #suiteNameFromMethods:
Claus Gittinger <cg@exept.de>
parents:
10836
diff
changeset
|
164 |
(methods |
d2f4dee8391f
changed: #suiteNameFromMethods:
Claus Gittinger <cg@exept.de>
parents:
10836
diff
changeset
|
165 |
collect:[:m|m mclass] |
d2f4dee8391f
changed: #suiteNameFromMethods:
Claus Gittinger <cg@exept.de>
parents:
10836
diff
changeset
|
166 |
thenSelect:[:c | c notNil]) asSet) |
9952 | 167 |
|
168 |
"Created: / 15-03-2010 / 13:22:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
169 |
! |
|
170 |
||
171 |
suiteNameFromProtocols: protocols |
|
12763
37d514cde1d5
class: Tools::AbstractTestRunner
Claus Gittinger <cg@exept.de>
parents:
11849
diff
changeset
|
172 |
|numProtocols| |
9952 | 173 |
|
12763
37d514cde1d5
class: Tools::AbstractTestRunner
Claus Gittinger <cg@exept.de>
parents:
11849
diff
changeset
|
174 |
(numProtocols := protocols size) == 0 ifTrue:[ |
10836 | 175 |
^'tests' |
176 |
]. |
|
12763
37d514cde1d5
class: Tools::AbstractTestRunner
Claus Gittinger <cg@exept.de>
parents:
11849
diff
changeset
|
177 |
numProtocols == 1 ifTrue:[ |
10836 | 178 |
protocols anyOne notNil ifTrue:[ |
12763
37d514cde1d5
class: Tools::AbstractTestRunner
Claus Gittinger <cg@exept.de>
parents:
11849
diff
changeset
|
179 |
^'category "', protocols anyOne , '"' |
10836 | 180 |
] ifFalse:[ |
181 |
^'tests' |
|
182 |
] |
|
183 |
]. |
|
12763
37d514cde1d5
class: Tools::AbstractTestRunner
Claus Gittinger <cg@exept.de>
parents:
11849
diff
changeset
|
184 |
^numProtocols printString , ' categories' |
9952 | 185 |
|
186 |
"Created: / 15-03-2010 / 13:22:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10836 | 187 |
"Modified: / 18-10-2011 / 22:59:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9952 | 188 |
! ! |
189 |
||
190 |
!AbstractTestRunner class methodsFor:'documentation'! |
|
191 |
||
10604 | 192 |
version |
12763
37d514cde1d5
class: Tools::AbstractTestRunner
Claus Gittinger <cg@exept.de>
parents:
11849
diff
changeset
|
193 |
^ '$Header: /cvs/stx/stx/libtool/Tools__AbstractTestRunner.st,v 1.12 2013-05-21 20:21:26 cg Exp $' |
10604 | 194 |
! |
195 |
||
9952 | 196 |
version_CVS |
12763
37d514cde1d5
class: Tools::AbstractTestRunner
Claus Gittinger <cg@exept.de>
parents:
11849
diff
changeset
|
197 |
^ '$Header: /cvs/stx/stx/libtool/Tools__AbstractTestRunner.st,v 1.12 2013-05-21 20:21:26 cg Exp $' |
9952 | 198 |
! |
199 |
||
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
200 |
version_HG |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
201 |
|
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
202 |
^ '$Changeset: <not expanded> $' |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
203 |
! |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
204 |
|
9952 | 205 |
version_SVN |
12763
37d514cde1d5
class: Tools::AbstractTestRunner
Claus Gittinger <cg@exept.de>
parents:
11849
diff
changeset
|
206 |
^ '$Id: Tools__AbstractTestRunner.st,v 1.12 2013-05-21 20:21:26 cg Exp $' |
9952 | 207 |
! ! |
208 |