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