9952
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2006 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
|
12 |
"{ Package: 'stx:libtool' }"
|
|
13 |
|
|
14 |
"{ NameSpace: Tools }"
|
|
15 |
|
|
16 |
ApplicationModel subclass:#AbstractTestRunner
|
|
17 |
instanceVariableNames:''
|
|
18 |
classVariableNames:'NotRunColor PassedColor FailureColor ErrorColor'
|
|
19 |
poolDictionaries:''
|
9957
|
20 |
category:'SUnit-UI'
|
9952
|
21 |
!
|
|
22 |
|
|
23 |
!AbstractTestRunner class methodsFor:'documentation'!
|
|
24 |
|
|
25 |
copyright
|
|
26 |
"
|
|
27 |
COPYRIGHT (c) 2006 by eXept Software AG
|
|
28 |
All Rights Reserved
|
|
29 |
|
|
30 |
This software is furnished under a license and may be used
|
|
31 |
only in accordance with the terms of that license and with the
|
|
32 |
inclusion of the above copyright notice. This software may not
|
|
33 |
be provided or otherwise made available to, or used by, any
|
|
34 |
other person. No title to or ownership of the software is
|
|
35 |
hereby transferred.
|
|
36 |
"
|
|
37 |
! !
|
|
38 |
|
|
39 |
!AbstractTestRunner class methodsFor:'initialization'!
|
|
40 |
|
|
41 |
initialize
|
|
42 |
"Invoked at system start or when the class is dynamically loaded."
|
|
43 |
|
|
44 |
NotRunColor := Color redByte:145 greenByte:145 blueByte:145.
|
|
45 |
PassedColor := Color redByte:92 greenByte:166 blueByte:92.
|
|
46 |
FailureColor := Color redByte:194 greenByte:110 blueByte:110.
|
|
47 |
ErrorColor := FailureColor
|
|
48 |
|
|
49 |
"Modified: / 15-03-2010 / 21:59:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
50 |
! !
|
|
51 |
|
|
52 |
!AbstractTestRunner class methodsFor:'accessing'!
|
|
53 |
|
|
54 |
errorColor
|
|
55 |
^ ErrorColor
|
|
56 |
|
|
57 |
"Created: / 07-02-2010 / 14:43:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
58 |
"Modified: / 15-03-2010 / 21:53:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
59 |
!
|
|
60 |
|
|
61 |
failedColor
|
|
62 |
^ FailureColor
|
|
63 |
|
|
64 |
"Modified: / 15-03-2010 / 21:53:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
65 |
!
|
|
66 |
|
|
67 |
notRunColor
|
|
68 |
^ NotRunColor
|
|
69 |
|
|
70 |
"Created: / 15-03-2010 / 09:55:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
71 |
"Modified: / 15-03-2010 / 21:53:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
72 |
!
|
|
73 |
|
|
74 |
passedColor
|
|
75 |
^ PassedColor
|
|
76 |
|
|
77 |
"Modified: / 15-03-2010 / 21:54:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
78 |
! !
|
|
79 |
|
|
80 |
!AbstractTestRunner methodsFor:'private'!
|
|
81 |
|
|
82 |
buildSuiteFromClass:testCaseCls
|
|
83 |
|
|
84 |
^testCaseCls asTestCase buildSuite
|
|
85 |
|
|
86 |
"Modified: / 04-03-2011 / 08:22:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
87 |
!
|
|
88 |
|
|
89 |
isTestCaseLike:cls
|
|
90 |
|
|
91 |
^cls isTestCaseLike
|
|
92 |
|
|
93 |
"Modified: / 28-02-2011 / 21:31:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
94 |
! !
|
|
95 |
|
|
96 |
!AbstractTestRunner methodsFor:'utilities'!
|
|
97 |
|
|
98 |
suiteNameFromClasses: classes
|
|
99 |
|
|
100 |
classes size = 1 ifTrue:
|
|
101 |
[^classes anyOne nameWithoutPrefix].
|
|
102 |
classes size = 2 ifTrue:
|
|
103 |
[^String streamContents:
|
|
104 |
[:s|classes
|
|
105 |
do:[:cls|s nextPutAll: cls nameWithoutPrefix]
|
|
106 |
separatedBy:[s nextPutAll:' & ']]].
|
|
107 |
|
|
108 |
^classes size printString , ' test cases'.
|
|
109 |
|
|
110 |
"Created: / 15-03-2010 / 13:23:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
111 |
!
|
|
112 |
|
|
113 |
suiteNameFromMethods: methods
|
|
114 |
|
|
115 |
methods size = 1 ifTrue:[^methods anyOne selector].
|
|
116 |
^methods size printString , ' tests from ' ,
|
|
117 |
(self suiteNameFromClasses: (methods collect:[:m|m mclass]) asSet)
|
|
118 |
|
|
119 |
"Created: / 15-03-2010 / 13:22:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
120 |
!
|
|
121 |
|
|
122 |
suiteNameFromProtocols: protocols
|
|
123 |
|
|
124 |
protocols size = 1 ifTrue:[^'tests categorized "', protocols anyOne , '"'].
|
|
125 |
^'tests in ', protocols size printString , ' categories'
|
|
126 |
|
|
127 |
"Created: / 15-03-2010 / 13:22:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
128 |
"Modified: / 15-03-2010 / 19:53:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
129 |
! !
|
|
130 |
|
|
131 |
!AbstractTestRunner class methodsFor:'documentation'!
|
|
132 |
|
|
133 |
version_CVS
|
9957
|
134 |
^ '$Header: /cvs/stx/stx/libtool/Tools__AbstractTestRunner.st,v 1.2 2011-06-30 19:53:50 cg Exp $'
|
9952
|
135 |
!
|
|
136 |
|
|
137 |
version_SVN
|
|
138 |
^ '§Id: Tools__AbstractTestRunner.st 7681 2011-03-04 11:30:02Z vranyj1 §'
|
|
139 |
! !
|
|
140 |
|
|
141 |
AbstractTestRunner initialize!
|