author | vrany |
Sat, 20 Aug 2011 16:05:31 +0200 | |
changeset 10604 | 3f6100dcea47 |
parent 10167 | 32f3659ee1aa |
child 10609 | d50122fc7b4f |
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 |
|
9952 | 4 |
|
10091 | 5 |
Permission is hereby granted, free of charge, to any person |
6 |
obtaining a copy of this software and associated documentation |
|
7 |
files (the 'Software'), to deal in the Software without |
|
8 |
restriction, including without limitation the rights to use, |
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
10 |
copies of the Software, and to permit persons to whom the |
|
11 |
Software is furnished to do so, subject to the following |
|
12 |
conditions: |
|
13 |
||
14 |
The above copyright notice and this permission notice shall be |
|
15 |
included in all copies or substantial portions of the Software. |
|
16 |
||
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
24 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9952 | 25 |
" |
26 |
"{ Package: 'stx:libtool' }" |
|
27 |
||
28 |
"{ NameSpace: Tools }" |
|
29 |
||
30 |
ApplicationModel subclass:#AbstractTestRunner |
|
31 |
instanceVariableNames:'' |
|
10167
32f3659ee1aa
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10091
diff
changeset
|
32 |
classVariableNames:'NotRunColor PassedColor FailureColor ErrorColor |
32f3659ee1aa
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10091
diff
changeset
|
33 |
CurrentlyRunningColor' |
9952 | 34 |
poolDictionaries:'' |
9957 | 35 |
category:'SUnit-UI' |
9952 | 36 |
! |
37 |
||
10604 | 38 |
TestResultStX subclass:#RunWithDebugTestResult |
39 |
instanceVariableNames:'' |
|
40 |
classVariableNames:'' |
|
41 |
poolDictionaries:'' |
|
42 |
privateIn:AbstractTestRunner |
|
43 |
! |
|
44 |
||
9952 | 45 |
!AbstractTestRunner class methodsFor:'documentation'! |
46 |
||
47 |
copyright |
|
48 |
" |
|
10091 | 49 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
50 |
Copyright (c) 2009-2010 eXept Software AG |
|
51 |
||
52 |
Permission is hereby granted, free of charge, to any person |
|
53 |
obtaining a copy of this software and associated documentation |
|
54 |
files (the 'Software'), to deal in the Software without |
|
55 |
restriction, including without limitation the rights to use, |
|
56 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
57 |
copies of the Software, and to permit persons to whom the |
|
58 |
Software is furnished to do so, subject to the following |
|
59 |
conditions: |
|
9952 | 60 |
|
10091 | 61 |
The above copyright notice and this permission notice shall be |
62 |
included in all copies or substantial portions of the Software. |
|
63 |
||
64 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
65 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
66 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
67 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
68 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
69 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
70 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
71 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9952 | 72 |
" |
73 |
! ! |
|
74 |
||
75 |
!AbstractTestRunner class methodsFor:'initialization'! |
|
76 |
||
77 |
initialize |
|
78 |
"Invoked at system start or when the class is dynamically loaded." |
|
79 |
||
10167
32f3659ee1aa
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10091
diff
changeset
|
80 |
CurrentlyRunningColor := Color yellow. |
32f3659ee1aa
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10091
diff
changeset
|
81 |
NotRunColor := Color redByte:145 greenByte:145 blueByte:145. |
32f3659ee1aa
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10091
diff
changeset
|
82 |
PassedColor := Color redByte:92 greenByte:166 blueByte:92. |
32f3659ee1aa
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10091
diff
changeset
|
83 |
FailureColor := Color redByte:194 greenByte:110 blueByte:110. |
32f3659ee1aa
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10091
diff
changeset
|
84 |
ErrorColor := FailureColor |
9952 | 85 |
|
86 |
"Modified: / 15-03-2010 / 21:59:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10167
32f3659ee1aa
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10091
diff
changeset
|
87 |
"Modified: / 05-07-2011 / 14:12:34 / cg" |
9952 | 88 |
! ! |
89 |
||
10604 | 90 |
!AbstractTestRunner class methodsFor:'instance creation'! |
91 |
||
92 |
newRunWithDebugTestResult |
|
93 |
||
94 |
^RunWithDebugTestResult new |
|
95 |
||
96 |
"Created: / 20-08-2011 / 13:54:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
97 |
! ! |
|
98 |
||
9952 | 99 |
!AbstractTestRunner class methodsFor:'accessing'! |
100 |
||
10167
32f3659ee1aa
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10091
diff
changeset
|
101 |
currentlyRunningColor |
32f3659ee1aa
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10091
diff
changeset
|
102 |
^ CurrentlyRunningColor |
32f3659ee1aa
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10091
diff
changeset
|
103 |
|
32f3659ee1aa
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10091
diff
changeset
|
104 |
"Created: / 05-07-2011 / 14:12:04 / cg" |
32f3659ee1aa
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10091
diff
changeset
|
105 |
! |
32f3659ee1aa
changed: #resultBackgroundColorAspect
Claus Gittinger <cg@exept.de>
parents:
10091
diff
changeset
|
106 |
|
9952 | 107 |
errorColor |
108 |
^ ErrorColor |
|
109 |
||
110 |
"Created: / 07-02-2010 / 14:43:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
111 |
"Modified: / 15-03-2010 / 21:53:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
112 |
! |
|
113 |
||
114 |
failedColor |
|
115 |
^ FailureColor |
|
116 |
||
117 |
"Modified: / 15-03-2010 / 21:53:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
118 |
! |
|
119 |
||
120 |
notRunColor |
|
121 |
^ NotRunColor |
|
122 |
||
123 |
"Created: / 15-03-2010 / 09:55:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
124 |
"Modified: / 15-03-2010 / 21:53:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
125 |
! |
|
126 |
||
127 |
passedColor |
|
128 |
^ PassedColor |
|
129 |
||
130 |
"Modified: / 15-03-2010 / 21:54:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
131 |
! ! |
|
132 |
||
133 |
!AbstractTestRunner methodsFor:'private'! |
|
134 |
||
135 |
buildSuiteFromClass:testCaseCls |
|
136 |
||
137 |
^testCaseCls asTestCase buildSuite |
|
138 |
||
139 |
"Modified: / 04-03-2011 / 08:22:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
140 |
! |
|
141 |
||
142 |
isTestCaseLike:cls |
|
143 |
||
144 |
^cls isTestCaseLike |
|
145 |
||
146 |
"Modified: / 28-02-2011 / 21:31:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
147 |
! ! |
|
148 |
||
149 |
!AbstractTestRunner methodsFor:'utilities'! |
|
150 |
||
151 |
suiteNameFromClasses: classes |
|
152 |
||
153 |
classes size = 1 ifTrue: |
|
154 |
[^classes anyOne nameWithoutPrefix]. |
|
155 |
classes size = 2 ifTrue: |
|
156 |
[^String streamContents: |
|
157 |
[:s|classes |
|
158 |
do:[:cls|s nextPutAll: cls nameWithoutPrefix] |
|
159 |
separatedBy:[s nextPutAll:' & ']]]. |
|
160 |
||
161 |
^classes size printString , ' test cases'. |
|
162 |
||
163 |
"Created: / 15-03-2010 / 13:23:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
164 |
! |
|
165 |
||
166 |
suiteNameFromMethods: methods |
|
167 |
||
168 |
methods size = 1 ifTrue:[^methods anyOne selector]. |
|
169 |
^methods size printString , ' tests from ' , |
|
170 |
(self suiteNameFromClasses: (methods collect:[:m|m mclass]) asSet) |
|
171 |
||
172 |
"Created: / 15-03-2010 / 13:22:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
173 |
! |
|
174 |
||
175 |
suiteNameFromProtocols: protocols |
|
176 |
||
177 |
protocols size = 1 ifTrue:[^'tests categorized "', protocols anyOne , '"']. |
|
178 |
^'tests in ', protocols size printString , ' categories' |
|
179 |
||
180 |
"Created: / 15-03-2010 / 13:22:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
181 |
"Modified: / 15-03-2010 / 19:53:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
182 |
! ! |
|
183 |
||
10604 | 184 |
!AbstractTestRunner::RunWithDebugTestResult methodsFor:'outcome'! |
185 |
||
186 |
rememberException:exception |
|
187 |
||
188 |
super rememberException: exception. |
|
189 |
^exception reject. |
|
190 |
||
191 |
"Created: / 20-08-2011 / 13:32:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
192 |
! ! |
|
193 |
||
9952 | 194 |
!AbstractTestRunner class methodsFor:'documentation'! |
195 |
||
10604 | 196 |
version |
197 |
^ '$Header: /cvs/stx/stx/libtool/Tools__AbstractTestRunner.st,v 1.5 2011-08-20 14:05:31 vrany Exp $' |
|
198 |
! |
|
199 |
||
9952 | 200 |
version_CVS |
10604 | 201 |
^ '$Header: /cvs/stx/stx/libtool/Tools__AbstractTestRunner.st,v 1.5 2011-08-20 14:05:31 vrany Exp $' |
9952 | 202 |
! |
203 |
||
204 |
version_SVN |
|
205 |
^ '§Id: Tools__AbstractTestRunner.st 7681 2011-03-04 11:30:02Z vranyj1 §' |
|
206 |
! ! |
|
207 |
||
208 |
AbstractTestRunner initialize! |