TestRunner.st
changeset 222 8e6f482297fa
parent 206 19f999435a5c
child 442 3b3e35ac7096
equal deleted inserted replaced
221:914934672e32 222:8e6f482297fa
    11 
    11 
    12 !TestRunner class methodsFor:'documentation'!
    12 !TestRunner class methodsFor:'documentation'!
    13 
    13 
    14 documentation
    14 documentation
    15 "
    15 "
    16     This GUI is based on SUnit2.7 and 
    16     This GUI is based on SUnit2.7 and
    17     was ported to ST/X by Samuel S. Schuster (as 2.7)  (thanks, indeed)
    17     was ported to ST/X by Samuel S. Schuster (as 2.7)  (thanks, indeed)
    18 
    18 
    19     It was slightly enhanced by adding a rerun-defects, browse and
    19     It was slightly enhanced by adding a rerun-defects, browse and
    20     a category selector (to minor revision 2.7d, in the meantime)
    20     a category selector (to minor revision 2.7d, in the meantime)
    21 " 
    21 "
    22 ! !
    22 ! !
    23 
    23 
    24 !TestRunner class methodsFor:'defaults'!
    24 !TestRunner class methodsFor:'defaults'!
    25 
    25 
    26 colorForFailedTests
    26 colorForFailedTests
    88      TestRunner open
    88      TestRunner open
    89     "
    89     "
    90 
    90 
    91     <resource: #canvas>
    91     <resource: #canvas>
    92 
    92 
    93     ^ 
    93     ^
    94      #(FullSpec
    94      #(FullSpec
    95         name: windowSpec
    95 	name: windowSpec
    96         window: 
    96 	window:
    97        (WindowSpec
    97        (WindowSpec
    98           label: 'SUnit Camp Smalltalk 3.1/STX TestRunner'
    98 	  label: 'SUnit Camp Smalltalk 3.1/STX TestRunner'
    99           name: 'SUnit Camp Smalltalk 3.1/STX TestRunner'
    99 	  name: 'SUnit Camp Smalltalk 3.1/STX TestRunner'
   100           min: (Point 362 122)
   100 	  min: (Point 362 122)
   101           bounds: (Rectangle 0 0 493 175)
   101 	  bounds: (Rectangle 0 0 493 175)
   102           icon: defaultIcon
   102 	  icon: defaultIcon
   103         )
   103 	)
   104         component: 
   104 	component:
   105        (SpecCollection
   105        (SpecCollection
   106           collection: (
   106 	  collection: (
   107            (ActionButtonSpec
   107 	   (ActionButtonSpec
   108               label: 'Refresh'
   108 	      label: 'Refresh'
   109               name: 'RefreshButton'
   109 	      name: 'RefreshButton'
   110               layout: (LayoutFrame 0 0 0 0 75 0 48 0)
   110 	      layout: (LayoutFrame 0 0 0 0 75 0 48 0)
   111               activeHelpKey: refreshSuitesButton
   111 	      activeHelpKey: refreshSuitesButton
   112               tabable: true
   112 	      tabable: true
   113               model: refreshSuites
   113 	      model: refreshSuites
   114             )
   114 	    )
   115            (MenuButtonSpec
   115 	   (MenuButtonSpec
   116               name: 'category'
   116 	      name: 'category'
   117               layout: (LayoutFrame 76 0 0 0 -216 1 24 0)
   117 	      layout: (LayoutFrame 76 0 0 0 -216 1 24 0)
   118               activeHelpKey: suitesCategoryList
   118 	      activeHelpKey: suitesCategoryList
   119               tabable: true
   119 	      tabable: true
   120               model: category
   120 	      model: category
   121               menu: categoryList
   121 	      menu: categoryList
   122             )
   122 	    )
   123            (MenuButtonSpec
   123 	   (MenuButtonSpec
   124               name: tests
   124 	      name: tests
   125               layout: (LayoutFrame 76 0 24 0 -216 1 48 0)
   125 	      layout: (LayoutFrame 76 0 24 0 -216 1 48 0)
   126               activeHelpKey: suiteSelection
   126 	      activeHelpKey: suiteSelection
   127               tabable: true
   127 	      tabable: true
   128               model: script
   128 	      model: script
   129               menu: scriptModel
   129 	      menu: scriptModel
   130               useIndex: true
   130 	      useIndex: true
   131             )
   131 	    )
   132            (ActionButtonSpec
   132 	   (ActionButtonSpec
   133               label: 'Run'
   133 	      label: 'Run'
   134               name: 'RunButton'
   134 	      name: 'RunButton'
   135               layout: (LayoutFrame -215 1 0 0 -160 1 48 0)
   135 	      layout: (LayoutFrame -215 1 0 0 -160 1 48 0)
   136               activeHelpKey: runButton
   136 	      activeHelpKey: runButton
   137               tabable: true
   137 	      tabable: true
   138               model: runTests
   138 	      model: runTests
   139               enableChannel: enableRunButton
   139 	      enableChannel: enableRunButton
   140             )
   140 	    )
   141            (ActionButtonSpec
   141 	   (ActionButtonSpec
   142               label: 'ReRun Defects'
   142 	      label: 'ReRun Defects'
   143               name: 'ReRunButton'
   143 	      name: 'ReRunButton'
   144               layout: (LayoutFrame -159 1 0 0 -57 1 48 0)
   144 	      layout: (LayoutFrame -159 1 0 0 -57 1 48 0)
   145               activeHelpKey: rerunDefectsButton
   145 	      activeHelpKey: rerunDefectsButton
   146               tabable: true
   146 	      tabable: true
   147               model: runDefects
   147 	      model: runDefects
   148               enableChannel: enableDefects
   148 	      enableChannel: enableDefects
   149             )
   149 	    )
   150            (ActionButtonSpec
   150 	   (ActionButtonSpec
   151               label: 'Run All'
   151 	      label: 'Run All'
   152               name: 'RunAllButton'
   152 	      name: 'RunAllButton'
   153               layout: (LayoutFrame -56 1 0 0 0 1 48 0)
   153 	      layout: (LayoutFrame -56 1 0 0 0 1 48 0)
   154               activeHelpKey: runAllButton
   154 	      activeHelpKey: runAllButton
   155               tabable: true
   155 	      tabable: true
   156               model: runAllTests
   156 	      model: runAllTests
   157             )
   157 	    )
   158            (ProgressIndicatorSpec
   158 	   (ProgressIndicatorSpec
   159               name: 'ProgressIndicator1'
   159 	      name: 'ProgressIndicator1'
   160               layout: (LayoutFrame 0 0.0 49 0 0 1.0 60 0)
   160 	      layout: (LayoutFrame 0 0.0 49 0 0 1.0 60 0)
   161               visibilityChannel: percentageIndicatorVisible
   161 	      visibilityChannel: percentageIndicatorVisible
   162               model: percentageDone
   162 	      model: percentageDone
   163               foregroundColor: (Color 32.999160753796 32.999160753796 0.0)
   163 	      foregroundColor: (Color 32.999160753796 32.999160753796 0.0)
   164               backgroundColor: (Color 66.999313344015 66.999313344015 0.0)
   164 	      backgroundColor: (Color 66.999313344015 66.999313344015 0.0)
   165               showPercentage: false
   165 	      showPercentage: false
   166             )
   166 	    )
   167            (LabelSpec
   167 	   (LabelSpec
   168               label: '...'
   168 	      label: '...'
   169               name: 'details'
   169 	      name: 'details'
   170               layout: (LayoutFrame 0 0 21 0.5 0 1 -25 1)
   170 	      layout: (LayoutFrame 0 0 21 0.5 0 1 -25 1)
   171               labelChannel: details
   171 	      labelChannel: details
   172             )
   172 	    )
   173            (LabelSpec
   173 	   (LabelSpec
   174               label: 'N/A'
   174 	      label: 'N/A'
   175               name: 'mode'
   175 	      name: 'mode'
   176               layout: (LayoutFrame 0 0 49 0 0 1 35 0.5)
   176 	      layout: (LayoutFrame 0 0 49 0 0 1 35 0.5)
   177               style: (FontDescription Arial bold roman 14)
   177 	      style: (FontDescription Arial bold roman 14)
   178               labelChannel: mode
   178 	      labelChannel: mode
   179             )
   179 	    )
   180            (MenuButtonSpec
   180 	   (MenuButtonSpec
   181               name: defects
   181 	      name: defects
   182               layout: (LayoutFrame 0 0 -24 1 -152 1 0 1)
   182 	      layout: (LayoutFrame 0 0 -24 1 -152 1 0 1)
   183               isOpaque: true
   183 	      isOpaque: true
   184               flags: 40
   184 	      flags: 40
   185               activeHelpKey: defectsList
   185 	      activeHelpKey: defectsList
   186               tabable: true
   186 	      tabable: true
   187               model: selectionHolder
   187 	      model: selectionHolder
   188               initiallyDisabled: true
   188 	      initiallyDisabled: true
   189               enableChannel: enableDefects
   189 	      enableChannel: enableDefects
   190               menu: defectMenu
   190 	      menu: defectMenu
   191               ignoreReselect: false
   191 	      ignoreReselect: false
   192             )
   192 	    )
   193            (ActionButtonSpec
   193 	   (ActionButtonSpec
   194               label: 'Browse'
   194 	      label: 'Browse'
   195               name: 'BrowseButton'
   195 	      name: 'BrowseButton'
   196               layout: (LayoutFrame -151 1 -24 1 -76 1 0 1)
   196 	      layout: (LayoutFrame -151 1 -24 1 -76 1 0 1)
   197               activeHelpKey: browseButton
   197 	      activeHelpKey: browseButton
   198               tabable: true
   198 	      tabable: true
   199               model: browseSelectedTestCase
   199 	      model: browseSelectedTestCase
   200               initiallyDisabled: true
   200 	      initiallyDisabled: true
   201               enableChannel: enableRunButton
   201 	      enableChannel: enableRunButton
   202             )
   202 	    )
   203            (ActionButtonSpec
   203 	   (ActionButtonSpec
   204               label: 'Debug'
   204 	      label: 'Debug'
   205               name: 'DebugButton'
   205 	      name: 'DebugButton'
   206               layout: (LayoutFrame -75 1 -24 1 0 1 0 1)
   206 	      layout: (LayoutFrame -75 1 -24 1 0 1 0 1)
   207               activeHelpKey: debugButton
   207 	      activeHelpKey: debugButton
   208               tabable: true
   208 	      tabable: true
   209               model: debugSelectedFailure
   209 	      model: debugSelectedFailure
   210               initiallyDisabled: true
   210 	      initiallyDisabled: true
   211               enableChannel: enableDebugButton
   211 	      enableChannel: enableDebugButton
   212             )
   212 	    )
   213            )
   213 	   )
   214          
   214 
   215         )
   215 	)
   216       )
   216       )
   217 ! !
   217 ! !
   218 
   218 
   219 !TestRunner class methodsFor:'opening'!
   219 !TestRunner class methodsFor:'opening'!
   220 
   220 
   236 
   236 
   237     "/ the test should be executed by the TestRunner process (not the caller)
   237     "/ the test should be executed by the TestRunner process (not the caller)
   238     "/ in oder for CTRL-C and busyCursor to work correctly.
   238     "/ in oder for CTRL-C and busyCursor to work correctly.
   239     "/ Therefore, push event instead of executing the test here.
   239     "/ Therefore, push event instead of executing the test here.
   240 
   240 
   241     "/runner runTests 
   241     "/runner runTests
   242     runner enqueueMessage:#runTests for:runner arguments:#().
   242     runner enqueueMessage:#runTests for:runner arguments:#().
   243 
   243 
   244     "
   244     "
   245      self openOnTestCase:CompilerTest
   245      self openOnTestCase:CompilerTest
   246      self openOnTestCase:ConstraintTests
   246      self openOnTestCase:ConstraintTests
   259     "Return a description of exported aspects;
   259     "Return a description of exported aspects;
   260      these can be connected to aspects of an embedding application
   260      these can be connected to aspects of an embedding application
   261      (if this app is embedded in a subCanvas)."
   261      (if this app is embedded in a subCanvas)."
   262 
   262 
   263     ^ #(
   263     ^ #(
   264         #script
   264 	#script
   265       ).
   265       ).
   266 
   266 
   267 ! !
   267 ! !
   268 
   268 
   269 !TestRunner methodsFor:'accessing'!
   269 !TestRunner methodsFor:'accessing'!
   270 
   270 
   271 category
   271 category
   272     |holder|
   272     |holder|
   273 
   273 
   274     (holder := builder bindingAt:#category) isNil ifTrue:[
   274     (holder := builder bindingAt:#category) isNil ifTrue:[
   275         holder := '* all *' asValue.
   275 	holder := '* all *' asValue.
   276         builder aspectAt:#category put:holder.
   276 	builder aspectAt:#category put:holder.
   277         holder onChangeSend:#categorySelectionChanged to:self.
   277 	holder onChangeSend:#categorySelectionChanged to:self.
   278     ].
   278     ].
   279     ^ holder.
   279     ^ holder.
   280 !
   280 !
   281 
   281 
   282 categoryList
   282 categoryList
   283     ^categoryModel isNil 
   283     ^categoryModel isNil
   284         ifTrue: [categoryModel := ValueHolder new. self updateCategoryList. categoryModel]
   284 	ifTrue: [categoryModel := ValueHolder new. self updateCategoryList. categoryModel]
   285         ifFalse: [categoryModel]
   285 	ifFalse: [categoryModel]
   286 !
   286 !
   287 
   287 
   288 defectMenu
   288 defectMenu
   289     "automatically generated by UIPainter ..."
   289     "automatically generated by UIPainter ..."
   290 
   290 
   291     "*** the code below creates a default model when invoked."
   291     "*** the code below creates a default model when invoked."
   292     "*** (which may not be the one you wanted)"
   292     "*** (which may not be the one you wanted)"
   293     "*** Please change as required and accept it in the browser."
   293     "*** Please change as required and accept it in the browser."
   294 
   294 
   295     ^defectMenu isNil 
   295     ^defectMenu isNil
   296 	ifTrue: [defectMenu := OrderedCollection new asValue]
   296 	ifTrue: [defectMenu := OrderedCollection new asValue]
   297 	ifFalse: [defectMenu]
   297 	ifFalse: [defectMenu]
   298 
   298 
   299     "Modified: / 4.4.2000 / 20:00:31 / Sames"
   299     "Modified: / 4.4.2000 / 20:00:31 / Sames"
   300 !
   300 !
   346     "*** the code below creates a default model when invoked."
   346     "*** the code below creates a default model when invoked."
   347     "*** (which may not be the one you wanted)"
   347     "*** (which may not be the one you wanted)"
   348     "*** Please change as required and accept it in the browser."
   348     "*** Please change as required and accept it in the browser."
   349 
   349 
   350     script isNil ifTrue:[
   350     script isNil ifTrue:[
   351         script := ValueHolder new.
   351 	script := ValueHolder new.
   352         script onChangeSend:#suiteSelectionChanged to:self.
   352 	script onChangeSend:#suiteSelectionChanged to:self.
   353     ].
   353     ].
   354     ^ script.
   354     ^ script.
   355 
   355 
   356     "Created: / 21.6.2000 / 12:04:36 / Sames"
   356     "Created: / 21.6.2000 / 12:04:36 / Sames"
   357 !
   357 !
   376     "Created: / 21.6.2000 / 12:04:36 / Sames"
   376     "Created: / 21.6.2000 / 12:04:36 / Sames"
   377 !
   377 !
   378 
   378 
   379 scriptModel
   379 scriptModel
   380     "This method was generated by UIDefiner.  Any edits made here
   380     "This method was generated by UIDefiner.  Any edits made here
   381         may be lost whenever methods are automatically defined.  The
   381 	may be lost whenever methods are automatically defined.  The
   382         initialization provided below may have been preempted by an
   382 	initialization provided below may have been preempted by an
   383         initialize method."
   383 	initialize method."
   384 
   384 
   385     ^scriptModel isNil 
   385     ^scriptModel isNil
   386         ifTrue: [scriptModel := ValueHolder new. self updateSuitesList. scriptModel]
   386 	ifTrue: [scriptModel := ValueHolder new. self updateSuitesList. scriptModel]
   387         ifFalse: [scriptModel]
   387 	ifFalse: [scriptModel]
   388 
   388 
   389     "Modified: / 2.4.2000 / 14:37:51 / Sames"
   389     "Modified: / 2.4.2000 / 14:37:51 / Sames"
   390 !
   390 !
   391 
   391 
   392 selection
   392 selection
   399 selectionHolder
   399 selectionHolder
   400 
   400 
   401     |holder|
   401     |holder|
   402 
   402 
   403     (holder := builder bindingAt:#selectionHolder) isNil ifTrue:[
   403     (holder := builder bindingAt:#selectionHolder) isNil ifTrue:[
   404         holder := AspectAdaptor new subject:self; forAspect:#selection.
   404 	holder := AspectAdaptor new subject:self; forAspect:#selection.
   405         builder aspectAt:#selectionHolder put:holder.
   405 	builder aspectAt:#selectionHolder put:holder.
   406     ].
   406     ].
   407     ^ holder.
   407     ^ holder.
   408 
   408 
   409     "Created: / 4.4.2000 / 18:46:08 / Sames"
   409     "Created: / 4.4.2000 / 18:46:08 / Sames"
   410     "Modified: / 4.4.2000 / 18:47:31 / Sames"
   410     "Modified: / 4.4.2000 / 18:47:31 / Sames"
   422 browseSelectedTestCase
   422 browseSelectedTestCase
   423     |testCaseName testCase browser defect singleCase|
   423     |testCaseName testCase browser defect singleCase|
   424 
   424 
   425     testCaseName := self selectedScript.
   425     testCaseName := self selectedScript.
   426     testCaseName isNil ifTrue:[
   426     testCaseName isNil ifTrue:[
   427         testCaseName := self tests contents.
   427 	testCaseName := self tests contents.
   428         testCaseName notNil ifTrue:[
   428 	testCaseName notNil ifTrue:[
   429             testCaseName := testCaseName string
   429 	    testCaseName := testCaseName string
   430         ]
   430 	]
   431     ].
   431     ].
   432     testCaseName notNil ifTrue:[
   432     testCaseName notNil ifTrue:[
   433         testCase := Smalltalk at:testCaseName asSymbol.
   433 	testCase := Smalltalk at:testCaseName asSymbol.
   434         testCase notNil ifTrue:[
   434 	testCase notNil ifTrue:[
   435             browser := UserPreferences current systemBrowserClass openInClass:testCase.
   435 	    browser := UserPreferences current systemBrowserClass openInClass:testCase.
   436             MessageNotUnderstood 
   436 	    MessageNotUnderstood
   437                 handle:[:ex | ]
   437 		handle:[:ex | ]
   438                 do:[ 
   438 		do:[
   439                     (defect := self selection) notNil ifTrue:[
   439 		    (defect := self selection) notNil ifTrue:[
   440                         singleCase := allDefects at:defect ifAbsent: [nil].
   440 			singleCase := allDefects at:defect ifAbsent: [nil].
   441                     ].
   441 		    ].
   442                     singleCase notNil ifTrue:[
   442 		    singleCase notNil ifTrue:[
   443                         browser switchToSelector:singleCase selector
   443 			browser switchToSelector:singleCase selector
   444                     ] ifFalse:[
   444 		    ] ifFalse:[
   445                         browser selectProtocolsMatching:'test*'
   445 			browser selectProtocolsMatching:'test*'
   446                     ]
   446 		    ]
   447                 ]
   447 		]
   448         ]
   448 	]
   449     ]
   449     ]
   450 !
   450 !
   451 
   451 
   452 categorySelectionChanged
   452 categorySelectionChanged
   453     |selectedScriptIndex selectedScript oldSuitesList newSuitesList 
   453     |selectedScriptIndex selectedScript oldSuitesList newSuitesList
   454      newScriptSelectionIndex|
   454      newScriptSelectionIndex|
   455 
   455 
   456     selectedScriptIndex := self script value.
   456     selectedScriptIndex := self script value.
   457     oldSuitesList := self scriptModel value.
   457     oldSuitesList := self scriptModel value.
   458 
   458 
   459     (selectedScriptIndex notNil and:[selectedScriptIndex ~~0]) ifTrue:[
   459     (selectedScriptIndex notNil and:[selectedScriptIndex ~~0]) ifTrue:[
   460         selectedScript := (oldSuitesList at:selectedScriptIndex) string
   460 	selectedScript := (oldSuitesList at:selectedScriptIndex) string
   461     ].
   461     ].
   462 
   462 
   463     self updateSuitesList.
   463     self updateSuitesList.
   464 
   464 
   465     newSuitesList := self scriptModel value.
   465     newSuitesList := self scriptModel value.
   466     newScriptSelectionIndex := newSuitesList indexOf:selectedScript.
   466     newScriptSelectionIndex := newSuitesList indexOf:selectedScript.
   467 
   467 
   468     self script value:(newScriptSelectionIndex == 0 
   468     self script value:(newScriptSelectionIndex == 0
   469                             ifTrue:[nil]
   469 			    ifTrue:[nil]
   470                             ifFalse:[newScriptSelectionIndex]).
   470 			    ifFalse:[newScriptSelectionIndex]).
   471 !
   471 !
   472 
   472 
   473 debugSelectedFailure
   473 debugSelectedFailure
   474 	self debugTest: self selection
   474 	self debugTest: self selection
   475 
   475 
   476     "Created: / 21.6.2000 / 10:58:58 / Sames"
   476     "Created: / 21.6.2000 / 10:58:58 / Sames"
   477     "Modified: / 21.6.2000 / 12:21:05 / Sames"
   477     "Modified: / 21.6.2000 / 12:21:05 / Sames"
   478 !
   478 !
   479 
   479 
   480 debugTest: aTestCaseName 
   480 debugTest: aTestCaseName
   481     | testCase |
   481     | testCase |
   482 
   482 
   483     defect := aTestCaseName.
   483     defect := aTestCaseName.
   484     testCase := allDefects at: aTestCaseName ifAbsent: [nil].
   484     testCase := allDefects at: aTestCaseName ifAbsent: [nil].
   485     testCase isNil ifTrue: [^self enableDebugButton value: false].
   485     testCase isNil ifTrue: [^self enableDebugButton value: false].
   488     self displayMode: 'Debugging'.
   488     self displayMode: 'Debugging'.
   489 
   489 
   490     "/ defect := nil.
   490     "/ defect := nil.
   491 
   491 
   492     self withWaitCursorDo:[
   492     self withWaitCursorDo:[
   493         ((result isFailure: testCase) "or:[(result isError: testCase)]")    
   493 	((result isFailure: testCase) "or:[(result isError: testCase)]")
   494             ifTrue: [testCase debugAsFailure]
   494 	    ifTrue: [testCase debugAsFailure]
   495             ifFalse: [testCase debug].
   495 	    ifFalse: [testCase debug].
   496     ].
   496     ].
   497 
   497 
   498     "Modified: / 21.6.2000 / 12:12:09 / Sames"
   498     "Modified: / 21.6.2000 / 12:12:09 / Sames"
   499 !
   499 !
   500 
   500 
   514 
   514 
   515     "Created: / 21.6.2000 / 10:47:34 / Sames"
   515     "Created: / 21.6.2000 / 10:47:34 / Sames"
   516 !
   516 !
   517 
   517 
   518 refreshSuites
   518 refreshSuites
   519         self updateCategoryList.
   519 	self updateCategoryList.
   520         self updateSuitesList.
   520 	self updateSuitesList.
   521 
   521 
   522         self script value:nil.
   522 	self script value:nil.
   523         self tests selection: 0.
   523 	self tests selection: 0.
   524         self defects selection: 0.
   524 	self defects selection: 0.
   525         result := TestResult new.
   525 	result := TestResult new.
   526         lastTestCase := nil.
   526 	lastTestCase := nil.
   527         self displayRefresh
   527 	self displayRefresh
   528 
   528 
   529     "Created: / 21.6.2000 / 10:58:34 / Sames"
   529     "Created: / 21.6.2000 / 10:58:34 / Sames"
   530     "Modified: / 21.6.2000 / 12:19:54 / Sames"
   530     "Modified: / 21.6.2000 / 12:19:54 / Sames"
   531 !
   531 !
   532 
   532 
   549 	^ self runDefectTests
   549 	^ self runDefectTests
   550     ].
   550     ].
   551     self runTests
   551     self runTests
   552 !
   552 !
   553 
   553 
   554 runSuite: aTestSuite 
   554 runSuite:aTestSuite
   555         |numTests|
   555     |numTests|
   556 
   556     "/ count the number of individual tests
   557         "/ count the number of individual tests
   557     numTests := 0.
   558         numTests := 0.
   558     aTestSuite tests do:
   559         aTestSuite tests do:[:eachTestOrSubSuite |
   559 	    [:eachTestOrSubSuite |
   560             (eachTestOrSubSuite isKindOf:TestSuite) ifTrue:[
   560 	    (eachTestOrSubSuite isKindOf:TestSuite)
   561                 numTests := numTests + eachTestOrSubSuite tests size.
   561 		ifTrue:[numTests := numTests + eachTestOrSubSuite tests size.]
   562             ] ifFalse:[
   562 		ifFalse:[numTests := numTests + 1.]].
   563                 numTests := numTests + 1.
   563     numberOfTestsToRun := numTests.
   564             ]
   564     self percentageDone value:0.
   565         ].
   565     Cursor wait showWhile:
   566         numberOfTestsToRun := numTests.
   566 	    [|errorCountBefore failureCountBefore|
   567         self percentageDone value:0.
   567 	    self displayRunning.
   568 
   568 
   569         Cursor 
   569 	    "/ self displayDetails: '...'.
   570             wait
   570 
   571                 showWhile:[
   571 	    aTestSuite addDependentToHierachy:self.
   572                     |errorCountBefore failureCountBefore|
   572 	    result := TestResult new.
   573 
   573 	    lastTestCase := aTestSuite.
   574                     self displayRunning.
   574 	    self showPercentageIndicator.
   575                     "/ self displayDetails: '...'.
   575 	    errorCountBefore := result errorCount.
   576                     aTestSuite addDependentToHierachy: self.
   576 	    failureCountBefore := result failureCount.
   577                     result := TestResult new.
   577 
   578                     lastTestCase := aTestSuite.
   578 	    [|caseName|
   579                     self showPercentageIndicator.
   579 	    aTestSuite
   580 
   580 		run:result
   581                     errorCountBefore :=  result errorCount.
   581 		beforeEachDo:
   582                     failureCountBefore := result failureCount.
   582 		    [:eachCase :eachResult |
   583 
   583 		    caseName := eachCase getTestName.
   584                     [
   584 		    caseName size == 0 ifTrue:[self halt].
   585                         |caseName|
   585 		    self displayDetails:(caseName , '...').
   586 
   586 		    self testPassed:caseName]
   587                         aTestSuite 
   587 		afterEachDo:
   588                             run:result 
   588 		    [:eachCase :eachResult |
   589                             beforeEachDo:[:eachCase :eachResult |  
   589 		    |passed errorCountAfter failureCountAfter|
   590                                 caseName := eachCase testName.
   590 		    errorCountAfter := result errorCount.
   591                                 caseName size == 0 ifTrue:[self halt].
   591 		    failureCountAfter := result failureCount.
   592 
   592 		    passed := (errorCountAfter == errorCountBefore)
   593                                 self displayDetails:(caseName , '...').
   593 				& (failureCountAfter == failureCountBefore).
   594                                 self testPassed:caseName
   594 		    passed == true
   595                             ]
   595 			ifTrue:
   596                             afterEachDo:[:eachCase :eachResult |  
   596 			    ["/                                    testsWhichPassed add:caseName.
   597                                 |passed errorCountAfter failureCountAfter|
   597 			    "/                                    testsWhichFailed remove:caseName ifAbsent:nil.
   598 
   598 			    ]
   599                                 errorCountAfter := result errorCount.
   599 			ifFalse:[self testFailed:caseName withResult:result].
   600                                 failureCountAfter := result failureCount.
   600 		    errorCountBefore := errorCountAfter.
   601                                 passed := (errorCountAfter == errorCountBefore) 
   601 		    failureCountBefore := failureCountAfter]] ensure:
   602                                           & (failureCountAfter == failureCountBefore).
   602 			[aTestSuite removeDependentFromHierachy:self.
   603 
   603 			self hidePercentageIndicator.
   604                                 passed == true ifTrue:[
   604 			self displayNormalColorInProgress.].
   605 "/                                    testsWhichPassed add:caseName.
   605 	    self updateWindow]
   606 "/                                    testsWhichFailed remove:caseName ifAbsent:nil.
       
   607                                 ] ifFalse:[
       
   608                                     self testFailed:caseName withResult:result
       
   609                                 ].
       
   610                                 errorCountBefore :=  errorCountAfter.
       
   611                                 failureCountBefore := failureCountAfter
       
   612                             ]
       
   613                     ] ensure: [
       
   614                         aTestSuite removeDependentFromHierachy: self.
       
   615                         self hidePercentageIndicator.
       
   616                         self displayNormalColorInProgress.
       
   617                     ].
       
   618 
       
   619                     self updateWindow
       
   620                 ]
       
   621 !
   606 !
   622 
   607 
   623 runTests
   608 runTests
   624 	| testSuite |
   609 	| testSuite |
   625 	(testSuite := self freshTestSuite) notNil ifTrue:
   610 	(testSuite := self freshTestSuite) notNil ifTrue:
   633 !
   618 !
   634 
   619 
   635 selection: aValue
   620 selection: aValue
   636 
   621 
   637     aValue = '' ifTrue:[
   622     aValue = '' ifTrue:[
   638         defect := aValue.
   623 	defect := aValue.
   639     ] ifFalse:[
   624     ] ifFalse:[
   640         self debugTest: aValue
   625 	self debugTest: aValue
   641     ].
   626     ].
   642 
   627 
   643     "Created: / 4.4.2000 / 18:54:09 / Sames"
   628     "Created: / 4.4.2000 / 18:54:09 / Sames"
   644     "Modified: / 4.4.2000 / 19:01:33 / Sames"
   629     "Modified: / 4.4.2000 / 19:01:33 / Sames"
   645 !
   630 !
   651     "/ self enableRunButton value:ok.
   636     "/ self enableRunButton value:ok.
   652     self enableRunButton value:self script value notNil.
   637     self enableRunButton value:self script value notNil.
   653     self enableDefects value:(ok and:[allDefects size > 0]).
   638     self enableDefects value:(ok and:[allDefects size > 0]).
   654 
   639 
   655     self script value notNil ifTrue:[
   640     self script value notNil ifTrue:[
   656         self selectedScript notNil ifTrue:[
   641 	self selectedScript notNil ifTrue:[
   657             className := self selectedScript string.
   642 	    className := self selectedScript string.
   658         ].
   643 	].
   659         (ok and:[className notNil]) ifTrue:[
   644 	(ok and:[className notNil]) ifTrue:[
   660             cls := Smalltalk at:className.
   645 	    cls := Smalltalk at:className.
   661             (cls class includesSelector:#description) ifTrue:[
   646 	    (cls class includesSelector:#description) ifTrue:[
   662                 description := cls description.
   647 		description := cls description.
   663             ]
   648 	    ]
   664         ].
   649 	].
   665     ].
   650     ].
   666     self displayDetails:nil.
   651     self displayDetails:nil.
   667     self displayMode: (description ? '').
   652     self displayMode: (description ? '').
   668     self displayGray.
   653     self displayGray.
   669 
   654 
   670     "Created: / 21.6.2000 / 11:31:25 / Sames"
   655     "Created: / 21.6.2000 / 11:31:25 / Sames"
   671     "Modified: / 21.6.2000 / 11:32:54 / Sames"
   656     "Modified: / 21.6.2000 / 11:32:54 / Sames"
   672 !
   657 !
   673 
   658 
   674 suitesInCategory
   659 suitesInCategory
   675         |suites cat allCategories|
   660 	|suites cat allCategories|
   676 
   661 
   677         cat := self category value.
   662 	cat := self category value.
   678         allCategories := (cat = '* all *').
   663 	allCategories := (cat = '* all *').
   679 
   664 
   680         suites := TestCase allSubclasses 
   665 	suites := TestCase allSubclasses
   681                         select:[:each | 
   666 			select:[:each |
   682                                 true "/ "cg:TestCaseHelper is gone -->" ((each isSubclassOf:TestCaseHelper) not) 
   667 				true "/ "cg:TestCaseHelper is gone -->" ((each isSubclassOf:TestCaseHelper) not)
   683                                 and:[each isAbstract not
   668 				and:[each isAbstract not
   684                                 and:[allCategories or:[cat = each category]]]]
   669 				and:[allCategories or:[cat = each category]]]]
   685                         thenCollect: [:each | each name].
   670 			thenCollect: [:each | each name].
   686         suites sort.
   671 	suites sort.
   687         ^ suites 
   672 	^ suites
   688 !
   673 !
   689 
   674 
   690 updateCategoryList
   675 updateCategoryList
   691         |categories|
   676 	|categories|
   692 
   677 
   693         categories := (TestCase allSubclasses collect: [:each | each category]) asSet asOrderedCollection.
   678 	categories := (TestCase allSubclasses collect: [:each | each category]) asSet asOrderedCollection.
   694         categories sort.
   679 	categories sort.
   695         categories addFirst:'* all *'.
   680 	categories addFirst:'* all *'.
   696         self categoryList value:categories.
   681 	self categoryList value:categories.
   697 !
   682 !
   698 
   683 
   699 updateSuitesList
   684 updateSuitesList
   700         |suites|
   685 	|suites|
   701 
   686 
   702         suites := self suitesInCategory.
   687 	suites := self suitesInCategory.
   703         suites := suites 
   688 	suites := suites
   704                     collect:[:eachSuiteName |
   689 		    collect:[:eachSuiteName |
   705                                 (testsWhichFailed includes:eachSuiteName) ifTrue:[
   690 				(testsWhichFailed includes:eachSuiteName) ifTrue:[
   706                                     eachSuiteName colorizeAllWith:(self class colorForFailedTests).
   691 				    eachSuiteName colorizeAllWith:(self class colorForFailedTests).
   707                                 ] ifFalse:[     
   692 				] ifFalse:[
   708                                     (testsWhichPassed includes:eachSuiteName) ifTrue:[
   693 				    (testsWhichPassed includes:eachSuiteName) ifTrue:[
   709                                         eachSuiteName colorizeAllWith:(self class colorForPassedTests).
   694 					eachSuiteName colorizeAllWith:(self class colorForPassedTests).
   710                                     ] ifFalse:[
   695 				    ] ifFalse:[
   711                                         eachSuiteName
   696 					eachSuiteName
   712                                     ]
   697 				    ]
   713                                 ].
   698 				].
   714                             ].
   699 			    ].
   715         self scriptModel value: suites.
   700 	self scriptModel value: suites.
   716 ! !
   701 ! !
   717 
   702 
   718 !TestRunner methodsFor:'private'!
   703 !TestRunner methodsFor:'private'!
   719 
   704 
   720 addToFailedTests:caseName
   705 addToFailedTests:caseName
   724 addToPassedTests:caseName
   709 addToPassedTests:caseName
   725     testsWhichPassed add:caseName.
   710     testsWhichPassed add:caseName.
   726 !
   711 !
   727 
   712 
   728 allTestSuite
   713 allTestSuite
   729         "generate and return a suite for all tests, except SUnitTests"
   714 	"generate and return a suite for all tests, except SUnitTests"
   730 
   715 
   731         | tokens stream suite|
   716 	| tokens stream suite|
   732 
   717 
   733         tokens := (self suitesInCategory
   718 	tokens := (self suitesInCategory
   734                           collect: [:eachName | eachName ", '*' " ])
   719 			  collect: [:eachName | eachName ", '*' " ])
   735                       copyWithout: 'SUnitTest* '.
   720 		      copyWithout: 'SUnitTest* '.
   736         stream := WriteStream on: String new.
   721 	stream := WriteStream on: String new.
   737         tokens do: [:each | stream nextPutAll:each; space].
   722 	tokens do: [:each | stream nextPutAll:each; space].
   738         suite := TestSuitesScripter run: stream contents.
   723 	suite := TestSuitesScripter run: stream contents.
   739         suite name:'all'.
   724 	suite name:'all'.
   740         ^ suite
   725 	^ suite
   741 !
   726 !
   742 
   727 
   743 defectTestSuite
   728 defectTestSuite
   744         |suite|
   729 	|suite|
   745 
   730 
   746         suite := TestSuite new.
   731 	suite := TestSuite new.
   747         suite name:'defects'.
   732 	suite name:'defects'.
   748         allDefects keysAndValuesDo:[:nm :test |
   733 	allDefects keysAndValuesDo:[:nm :test |
   749             suite addTest:test.
   734 	    suite addTest:test.
   750         ].
   735 	].
   751         ^suite
   736 	^suite
   752 !
   737 !
   753 
   738 
   754 formatTime: aTime 
   739 formatTime: aTime
   755 	aTime hours > 0 ifTrue: [^aTime hours printString , 'h'].
   740 	aTime hours > 0 ifTrue: [^aTime hours printString , 'h'].
   756 	aTime minutes > 0 ifTrue: [^aTime minutes printString , 'min'].
   741 	aTime minutes > 0 ifTrue: [^aTime minutes printString , 'min'].
   757 	^aTime seconds printString , ' sec'
   742 	^aTime seconds printString , ' sec'
   758 !
   743 !
   759 
   744 
   760 freshTestSuite
   745 freshTestSuite
   761         |tests suite|
   746 	|tests suite|
   762 
   747 
   763         tests := self tests contents.
   748 	tests := self tests contents.
   764         tests isNil ifTrue:[ ^ nil].
   749 	tests isNil ifTrue:[ ^ nil].
   765         tests := tests string.
   750 	tests := tests string.
   766         suite := TestSuitesScripter run: tests.
   751 	suite := TestSuitesScripter run: tests.
   767         ^ suite
   752 	^ suite
   768 
   753 
   769     "Modified: / 4.4.2000 / 20:13:41 / Sames"
   754     "Modified: / 4.4.2000 / 20:13:41 / Sames"
   770 !
   755 !
   771 
   756 
   772 initialize
   757 initialize
   774 
   759 
   775     testsWhichPassed := Set new.
   760     testsWhichPassed := Set new.
   776     testsWhichFailed := Set new.
   761     testsWhichFailed := Set new.
   777 
   762 
   778     TestCase allSubclassesDo:[:cls |
   763     TestCase allSubclassesDo:[:cls |
   779         |lastResult className|
   764 	|lastResult className|
   780 
   765 
   781         cls isAbstract ifFalse:[
   766 	cls isAbstract ifFalse:[
   782             lastResult := cls lastTestRunResultOrNil.
   767 	    lastResult := cls lastTestRunResultOrNil.
   783             lastResult notNil ifTrue:[
   768 	    lastResult notNil ifTrue:[
   784                 className := cls name.
   769 		className := cls name.
   785                 lastResult == true ifTrue:[
   770 		lastResult == true ifTrue:[
   786                     testsWhichPassed add:className
   771 		    testsWhichPassed add:className
   787                 ] ifFalse:[
   772 		] ifFalse:[
   788                     testsWhichFailed add:className
   773 		    testsWhichFailed add:className
   789                 ]
   774 		]
   790             ]
   775 	    ]
   791         ]
   776 	]
   792     ].
   777     ].
   793 !
   778 !
   794 
   779 
   795 postOpenWith: aBuilder 
   780 postOpenWith: aBuilder
   796     "automatically generated by UIPainter ..."
   781     "automatically generated by UIPainter ..."
   797 
   782 
   798     super postOpenWith: aBuilder.
   783     super postOpenWith: aBuilder.
   799     self tests defaultLabel: ''.
   784     self tests defaultLabel: ''.
   800     "/ self tests selection: 'ExampleSetTest'. self script value:1.
   785     "/ self tests selection: 'ExampleSetTest'. self script value:1.
   831 
   816 
   832     self updateCategoryList.
   817     self updateCategoryList.
   833 
   818 
   834     scriptClass := Smalltalk at:aScriptName asSymbol.
   819     scriptClass := Smalltalk at:aScriptName asSymbol.
   835     scriptClass notNil ifTrue:[
   820     scriptClass notNil ifTrue:[
   836         self category value:scriptClass category.
   821 	self category value:scriptClass category.
   837     ]
   822     ]
   838 !
   823 !
   839 
   824 
   840 selectedScript
   825 selectedScript
   841     |scriptIndex|
   826     |scriptIndex|
   842 
   827 
   843     scriptIndex := self script value.
   828     scriptIndex := self script value.
   844     scriptIndex isNil ifTrue:[
   829     scriptIndex isNil ifTrue:[
   845         ^ ''
   830 	^ ''
   846     ].
   831     ].
   847     ^ self scriptModel value at:scriptIndex ifAbsent:nil.
   832     ^ self scriptModel value at:scriptIndex ifAbsent:nil.
   848 !
   833 !
   849 
   834 
   850 testFailed:caseName withResult:result
   835 testFailed:caseName withResult:result
   852 
   837 
   853     self removeFromPassedTests:caseName.
   838     self removeFromPassedTests:caseName.
   854     self addToFailedTests:caseName.
   839     self addToFailedTests:caseName.
   855 
   840 
   856     (cls := Smalltalk classNamed:caseName) notNil ifTrue:[
   841     (cls := Smalltalk classNamed:caseName) notNil ifTrue:[
   857         cls rememberFailedTestRunWithResult:result.
   842 	cls rememberFailedTestRunWithResult:result.
   858     ].
   843     ].
   859 !
   844 !
   860 
   845 
   861 testPassed:caseName
   846 testPassed:caseName
   862     |cls|
   847     |cls|
   866 
   851 
   867 "/    Transcript show:'passed: '; showCR:caseName.
   852 "/    Transcript show:'passed: '; showCR:caseName.
   868 "/    Transcript show:'passed: '; showCR:caseName className.
   853 "/    Transcript show:'passed: '; showCR:caseName className.
   869 
   854 
   870     (cls := Smalltalk classNamed:caseName) notNil ifTrue:[
   855     (cls := Smalltalk classNamed:caseName) notNil ifTrue:[
   871         cls rememberPassedTestRun
   856 	cls rememberPassedTestRun
   872     ].
   857     ].
   873 !
   858 !
   874 
   859 
   875 timeSinceLastPassAsString
   860 timeSinceLastPassAsString
   876 	lastPass isNil ifTrue: [^''].
   861 	lastPass isNil ifTrue: [^''].
   894 
   879 
   895     "Created: / 21.6.2000 / 12:28:06 / Sames"
   880     "Created: / 21.6.2000 / 12:28:06 / Sames"
   896     "Modified: / 21.6.2000 / 12:35:09 / Sames"
   881     "Modified: / 21.6.2000 / 12:35:09 / Sames"
   897 !
   882 !
   898 
   883 
   899 displayDefects: aCollection 
   884 displayDefects: aCollection
   900     | failedTests|
   885     | failedTests|
   901     aCollection isEmpty ifTrue: [
   886     aCollection isEmpty ifTrue: [
   902         self selectionHolder value:''.
   887 	self selectionHolder value:''.
   903         self enableDefects value:false.
   888 	self enableDefects value:false.
   904         self enableDebugButton value:false.
   889 	self enableDebugButton value:false.
   905         ^ self
   890 	^ self
   906     ].
   891     ].
   907     allDefects := Dictionary new.
   892     allDefects := Dictionary new.
   908     aCollection do: [:each | allDefects at: each printString put: each].
   893     aCollection do: [:each | allDefects at: each printString put: each].
   909     failedTests := allDefects keys asOrderedCollection sort.
   894     failedTests := allDefects keys asOrderedCollection sort.
   910     self defectMenu value: failedTests.
   895     self defectMenu value: failedTests.
   912     self enableDefects value:true.
   897     self enableDefects value:true.
   913 
   898 
   914     "Modified: / 4.4.2000 / 20:11:06 / Sames"
   899     "Modified: / 4.4.2000 / 20:11:06 / Sames"
   915 !
   900 !
   916 
   901 
   917 displayDetails: aString 
   902 displayDetails: aString
   918     self details value: aString.
   903     self details value: aString.
   919     self repairDamage.
   904     self repairDamage.
   920 
   905 
   921     "Modified: / 21.6.2000 / 11:10:14 / Sames"
   906     "Modified: / 21.6.2000 / 11:10:14 / Sames"
   922 !
   907 !
   941 
   926 
   942 displayGreen
   927 displayGreen
   943 	self displayColor: ColorValue green
   928 	self displayColor: ColorValue green
   944 !
   929 !
   945 
   930 
   946 displayMode: aString 
   931 displayMode: aString
   947         self mode value: aString.
   932 	self mode value: aString.
   948         self repairDamage.
   933 	self repairDamage.
   949 
   934 
   950     "Modified: / 21.6.2000 / 11:14:19 / Sames"
   935     "Modified: / 21.6.2000 / 11:14:19 / Sames"
   951 !
   936 !
   952 
   937 
   953 displayNormalColorInProgress
   938 displayNormalColorInProgress
   956       backgroundColor: (Color red:67 green:67 blue:0)
   941       backgroundColor: (Color red:67 green:67 blue:0)
   957 !
   942 !
   958 
   943 
   959 displayPass
   944 displayPass
   960     self displayGreen.
   945     self displayGreen.
   961     (lastTestCase notNil 
   946     (lastTestCase notNil
   962     and:[lastTestCase name notNil]) ifTrue:[
   947     and:[lastTestCase name notNil]) ifTrue:[
   963         self displayMode: 'Pass ' , lastTestCase name.
   948 	self displayMode: 'Pass ' , lastTestCase name.
   964     ] ifFalse:[
   949     ] ifFalse:[
   965         self displayMode: 'Pass'.
   950 	self displayMode: 'Pass'.
   966     ].
   951     ].
   967     self displayDetails: result runCount printString , ' run' , self timeSinceLastPassAsString.
   952     self displayDetails: result runCount printString , ' run' , self timeSinceLastPassAsString.
   968     lastPass := Time now
   953     lastPass := Time now
   969 
   954 
   970     "Modified: / 21.6.2000 / 12:14:52 / Sames"
   955     "Modified: / 21.6.2000 / 12:14:52 / Sames"
   986     "Created: / 21.6.2000 / 12:14:11 / Sames"
   971     "Created: / 21.6.2000 / 12:14:11 / Sames"
   987     "Modified: / 21.6.2000 / 12:28:24 / Sames"
   972     "Modified: / 21.6.2000 / 12:28:24 / Sames"
   988 !
   973 !
   989 
   974 
   990 displayRunning
   975 displayRunning
   991         self displayRunning:(self selectedScript ? 'all') string.
   976 	self displayRunning:(self selectedScript ? 'all') string.
   992 !
   977 !
   993 
   978 
   994 displayRunning:scriptName
   979 displayRunning:scriptName
   995         self displayYellow.
   980 	self displayYellow.
   996         self displayMode:('running ' , scriptName allBold). 
   981 	self displayMode:('running ' , scriptName allBold).
   997 "/        self displayDetails: '...'.
   982 "/        self displayDetails: '...'.
   998         self repairDamage.
   983 	self repairDamage.
   999 !
   984 !
  1000 
   985 
  1001 displayYellow
   986 displayYellow
  1002 	self displayColor: ColorValue yellow
   987 	self displayColor: ColorValue yellow
  1003 !
   988 !
  1016     self percentageIndicatorVisible value:true.
  1001     self percentageIndicatorVisible value:true.
  1017 !
  1002 !
  1018 
  1003 
  1019 update:something with:aParameter from:changedObject
  1004 update:something with:aParameter from:changedObject
  1020     changedObject == Smalltalk ifTrue:[
  1005     changedObject == Smalltalk ifTrue:[
  1021         (changedObject isBehavior and:[changedObject isSubclassOf:TestCase]) ifTrue:[
  1006 	(changedObject isBehavior and:[changedObject isSubclassOf:TestCase]) ifTrue:[
  1022             self updateSuitesList
  1007 	    self updateSuitesList
  1023         ].
  1008 	].
  1024         ^ self
  1009 	^ self
  1025     ].
  1010     ].
  1026 
  1011 
  1027     (changedObject isKindOf: TestSuite) ifTrue: [
  1012     (changedObject isKindOf: TestSuite) ifTrue: [
  1028         self displayRunning:changedObject name.
  1013 	self displayRunning:changedObject name.
  1029         ^ self
  1014 	^ self
  1030     ].
  1015     ].
  1031 
  1016 
  1032     (changedObject isKindOf: TestCase) ifTrue: [
  1017     (changedObject isKindOf: TestCase) ifTrue: [
  1033         (result errorCount + result failureCount) > 0 ifTrue:[
  1018 	(result errorCount + result failureCount) > 0 ifTrue:[
  1034             self displayErrorColorInProgress.
  1019 	    self displayErrorColorInProgress.
  1035         ].
  1020 	].
  1036         self percentageDone value:(result runCount / numberOfTestsToRun * 100) rounded.
  1021 	self percentageDone value:(result runCount / numberOfTestsToRun * 100) rounded.
  1037         self displayDetails: changedObject printString.
  1022 	self displayDetails: changedObject printString.
  1038         ^ self
  1023 	^ self
  1039     ].
  1024     ].
  1040 
  1025 
  1041     super update:something with:aParameter from:changedObject
  1026     super update:something with:aParameter from:changedObject
  1042 !
  1027 !
  1043 
  1028 
  1044 updateDefects
  1029 updateDefects
  1045         |script|
  1030 	|script|
  1046 
  1031 
  1047         script := self selectedScript.
  1032 	script := self selectedScript.
  1048         script notNil ifTrue:[script := script string].
  1033 	script notNil ifTrue:[script := script string].
  1049 
  1034 
  1050         self displayDefects: result defects.
  1035 	self displayDefects: result defects.
  1051 
  1036 
  1052         script notNil ifTrue:[
  1037 	script notNil ifTrue:[
  1053             result hasPassed ifTrue:[
  1038 	    result hasPassed ifTrue:[
  1054                 self testPassed:script
  1039 		self testPassed:script
  1055             ] ifFalse:[
  1040 	    ] ifFalse:[
  1056                 self testFailed:script withResult:result
  1041 		self testFailed:script withResult:result
  1057             ].
  1042 	    ].
  1058         ].
  1043 	].
  1059 !
  1044 !
  1060 
  1045 
  1061 updateWindow
  1046 updateWindow
  1062         result hasPassed
  1047 	result hasPassed
  1063                 ifTrue: [self displayPass]
  1048 		ifTrue: [self displayPass]
  1064                 ifFalse: [self displayFail].
  1049 		ifFalse: [self displayFail].
  1065         self updateDefects.
  1050 	self updateDefects.
  1066         self updateSuitesList. "/ for colors
  1051 	self updateSuitesList. "/ for colors
  1067 ! !
  1052 ! !
  1068 
  1053 
  1069 !TestRunner class methodsFor:'documentation'!
  1054 !TestRunner class methodsFor:'documentation'!
  1070 
  1055 
  1071 version
  1056 version
  1072     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestRunner.st,v 1.59 2009-10-04 13:24:40 cg Exp $'
  1057     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestRunner.st,v 1.60 2011-06-29 19:15:49 cg Exp $'
  1073 !
  1058 !
  1074 
  1059 
  1075 version_CVS
  1060 version_CVS
  1076     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestRunner.st,v 1.59 2009-10-04 13:24:40 cg Exp $'
  1061     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestRunner.st,v 1.60 2011-06-29 19:15:49 cg Exp $'
       
  1062 !
       
  1063 
       
  1064 version_SVN
       
  1065     ^ '§Id: TestRunner.st 182 2009-12-05 18:12:17Z vranyj1 §'
  1077 ! !
  1066 ! !