188 name: 'RunnerInfoBox' |
188 name: 'RunnerInfoBox' |
189 backgroundChannel: resultBackgroundColorAspect |
189 backgroundChannel: resultBackgroundColorAspect |
190 component: |
190 component: |
191 (SpecCollection |
191 (SpecCollection |
192 collection: ( |
192 collection: ( |
193 (ViewSpec |
|
194 name: 'ProgressPanel' |
|
195 layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
196 initiallyInvisible: true |
|
197 visibilityChannel: progressIndicatorShownHolder |
|
198 backgroundChannel: resultBackgroundColorAspect |
|
199 component: |
|
200 (SpecCollection |
|
201 collection: ( |
|
202 (ProgressIndicatorSpec |
|
203 name: 'RunningProgress' |
|
204 layout: (LayoutFrame 5 0 -10 0.5 -5 1 10 0.5) |
|
205 model: progressHolder |
|
206 postBuildCallback: postBuildProgressIndicator: |
|
207 ) |
|
208 ) |
|
209 |
|
210 ) |
|
211 ) |
|
212 (LabelSpec |
193 (LabelSpec |
213 label: 'Run tests first!!' |
194 label: 'Run tests first!!' |
214 name: 'ResultName' |
195 name: 'ResultName' |
215 layout: (LayoutFrame 22 0 0 0 0 1 -10 1) |
196 layout: (LayoutFrame 22 0 0 0 0 1 -10 1) |
216 backgroundChannel: resultBackgroundColorAspect |
197 backgroundChannel: resultBackgroundColorAspect |
238 backgroundChannel: resultBackgroundColorAspect |
219 backgroundChannel: resultBackgroundColorAspect |
239 foregroundColor: (Color 100.0 100.0 100.0) |
220 foregroundColor: (Color 100.0 100.0 100.0) |
240 translateLabel: true |
221 translateLabel: true |
241 labelChannel: resultInfoAspect |
222 labelChannel: resultInfoAspect |
242 adjust: left |
223 adjust: left |
|
224 ) |
|
225 (ViewSpec |
|
226 name: 'ProgressPanel' |
|
227 layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
228 initiallyInvisible: true |
|
229 visibilityChannel: progressIndicatorShownHolder |
|
230 backgroundChannel: resultBackgroundColorAspect |
|
231 component: |
|
232 (SpecCollection |
|
233 collection: ( |
|
234 (ProgressIndicatorSpec |
|
235 name: 'RunningProgress' |
|
236 layout: (LayoutFrame 5 0 -10 0.5 -5 1 10 0.5) |
|
237 model: progressHolder |
|
238 postBuildCallback: postBuildProgressIndicator: |
|
239 ) |
|
240 ) |
|
241 |
|
242 ) |
243 ) |
243 ) |
244 ) |
244 ) |
245 |
245 |
246 ) |
246 ) |
247 extent: (Point 296 30) |
247 extent: (Point 296 30) |
872 "Modified: / 15-03-2010 / 20:55:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
866 "Modified: / 15-03-2010 / 20:55:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
873 "Modified: / 04-06-2012 / 19:03:15 / cg" |
867 "Modified: / 04-06-2012 / 19:03:15 / cg" |
874 ! |
868 ! |
875 |
869 |
876 updateTestCases |
870 updateTestCases |
877 allTestCases := ((self selectedClassesHolder value ? #()) |
871 "/ Nothing to do here |
878 select:[:cls | self isTestCaseLike:cls ]). |
872 |
879 allTestCases := allTestCases asArray |
873 "Created: / 23-09-2014 / 12:02:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
880 |
|
881 "Created: / 11-03-2010 / 10:31:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
882 "Modified: / 24-01-2012 / 22:09:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
883 "Modified: / 04-06-2012 / 19:02:52 / cg" |
|
884 ! |
874 ! |
885 |
875 |
886 updateTestSuiteAndResult |
876 updateTestSuiteAndResult |
887 |
877 |
888 | suite suiteAndResult | |
878 | suite suiteAndResult | |
992 "Modified: / 02-08-2011 / 18:20:00 / cg" |
982 "Modified: / 02-08-2011 / 18:20:00 / cg" |
993 "Modified: / 20-08-2011 / 14:30:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
983 "Modified: / 20-08-2011 / 14:30:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
994 ! |
984 ! |
995 |
985 |
996 suiteForRun |
986 suiteForRun |
997 "if methods are selected, a suite for those methods is built and returned. |
987 ^ self resultHolder value suiteForRun |
998 If protocoly are selected, a suite for all methods in those protocols |
988 |
999 is built and returned. |
989 "Modified: / 23-09-2014 / 12:07:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1000 Otherwise, a suite for all methods in the class is built and returned" |
|
1001 |
|
1002 | testMethods protocols suite selectedClass | |
|
1003 |
|
1004 selectedClass := self theSingleTestCase. |
|
1005 selectedMethodsHolder value notEmptyOrNil ifTrue:[ |
|
1006 testMethods := self selectedTestMethods. |
|
1007 suite := TestSuite named:(self suiteNameFromMethods:testMethods). |
|
1008 testMethods do:[:mthd | |
|
1009 | class selector | |
|
1010 |
|
1011 class := selectedClass isNil ifTrue:[mthd mclass] ifFalse:[ selectedClass ]. |
|
1012 suite addTest:(class asTestCase selector:mthd selector) |
|
1013 ]. |
|
1014 ^ suite |
|
1015 ]. |
|
1016 (protocols := selectedProtocolsHolder value) notEmptyOrNil ifTrue:[ |
|
1017 suite := TestSuite named:(self suiteNameFromProtocols:protocols). |
|
1018 (self selectedTestMethodsFromProtocols:protocols inClass:selectedClass) do:[:mthd | |
|
1019 | class selector | |
|
1020 |
|
1021 class := selectedClass isNil ifTrue:[mthd mclass] ifFalse:[ selectedClass ]. |
|
1022 suite addTest:(class asTestCase selector:mthd selector) |
|
1023 ]. |
|
1024 ^ suite |
|
1025 ]. |
|
1026 ^ self suiteForRunAll |
|
1027 |
|
1028 "Created: / 15-03-2010 / 13:13:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1029 "Modified: / 04-08-2011 / 19:06:42 / cg" |
|
1030 "Modified (format): / 23-09-2014 / 10:19:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1031 ! |
990 ! |
1032 |
991 |
1033 suiteForRunAll |
992 suiteForRunAll |
1034 |suite| |
993 "raise an error: must be redefined in concrete subclass(es)" |
1035 |
994 |
1036 allTestCases isNil ifTrue:[ |
995 ^ self suiteForRun |
1037 self updateTestCases. |
996 |
1038 ]. |
997 "Modified: / 23-09-2014 / 12:07:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1039 suite := TestSuite named:(self suiteNameFromClasses: self allTestCases). |
|
1040 |
|
1041 allTestCases do:[:testCase | |
|
1042 suite addTests:(self buildSuiteFromClass:testCase) tests |
|
1043 ]. |
|
1044 ^suite |
|
1045 |
|
1046 "Modified: / 04-03-2011 / 06:57:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1047 "Modified: / 04-06-2012 / 19:01:48 / cg" |
|
1048 ! |
998 ! |
1049 |
999 |
1050 suiteForRunFailed |
1000 suiteForRunFailed |
1051 |suite numTests| |
1001 |suite numTests| |
1052 |
1002 |
1053 suite := TestSuite named:(self suiteNameFromClasses: self allTestCases). |
1003 suite := TestSuite named:(self suiteNameFromClasses: self allTestCases). |
1054 numTests := 0. |
1004 numTests := 0. |
1055 |
1005 |
1056 self allTestCases do:[:testCase | |
1006 self suiteForRunAll tests do:[:eachTest | |
1057 (self buildSuiteFromClass:testCase) tests do:[:eachTest | |
1007 | sel cls | |
1058 | sel cls | |
1008 |
1059 |
1009 sel := eachTest selector. |
1060 sel := eachTest selector. |
1010 cls := eachTest class. |
1061 cls := eachTest class. |
1011 (cls testSelectorPassed:sel) ifFalse:[ |
1062 (cls testSelectorPassed:sel) ifFalse:[ |
1012 suite addTest:eachTest. |
1063 suite addTest:eachTest. |
1013 numTests := numTests + 1. |
1064 numTests := numTests + 1. |
|
1065 ] |
|
1066 ] |
1014 ] |
1067 ]. |
1015 ]. |
|
1016 |
1068 numTests == 1 ifTrue:[ |
1017 numTests == 1 ifTrue:[ |
1069 suite name:(suite tests first selector) |
1018 suite name:(suite tests first selector) |
1070 ] ifFalse:[ |
1019 ] ifFalse:[ |
1071 suite name:(suite tests size printString,' tests') |
1020 suite name:(suite tests size printString,' tests') |
1072 ]. |
1021 ]. |
1073 ^suite |
1022 ^suite |
1074 |
1023 |
1075 "Modified: / 04-03-2011 / 06:57:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1024 "Modified: / 23-09-2014 / 12:09:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1076 "Created: / 04-06-2012 / 18:32:40 / cg" |
|
1077 ! ! |
1025 ! ! |
1078 |
1026 |
1079 !TestRunnerMini::SuiteAndResult class methodsFor:'instance creation'! |
1027 !TestRunnerMini::SuiteAndResult class methodsFor:'instance creation'! |
1080 |
1028 |
1081 suite: suite result: result |
1029 suite: suite result: result |