TestCase.st
changeset 575 f55a221af068
parent 573 428c2391c132
child 576 55ef6aaf19cb
equal deleted inserted replaced
574:8ccb64f2e2f7 575:f55a221af068
   651 debug
   651 debug
   652 
   652 
   653     | testCase outcome result|
   653     | testCase outcome result|
   654 
   654 
   655     [
   655     [
   656         result := TestResult statePass.
   656         result := TestResult stateError.
   657         [
   657         [
   658             (testCase := self class selector: testSelector) runCase.
   658             (testCase := self class selector: testSelector) runCase.
       
   659             result := TestResult statePass.
   659         ] sunitOn:(TestResult failure) do: [:ex |
   660         ] sunitOn:(TestResult failure) do: [:ex |
   660             |con|
       
   661 
       
   662             ex creator == TestSkipped ifTrue:[
   661             ex creator == TestSkipped ifTrue:[
   663                 result := TestResult stateSkip.
   662                 result := TestResult stateSkip.
   664             ] ifFalse:[
   663             ] ifFalse:[
   665                 result := TestResult stateFail.
   664                 result := TestResult stateFail.
   666             ].
   665             ].
   674                     mayProceed:true.
   673                     mayProceed:true.
   675                 ex proceed. 
   674                 ex proceed. 
   676             ] ifFalse:[
   675             ] ifFalse:[
   677                 "is there a portable way to open a debugger?"
   676                 "is there a portable way to open a debugger?"
   678                 self halt:(ex description)
   677                 self halt:(ex description)
   679             ]
   678             ].
   680         ].
   679         ].
   681 
   680 
       
   681     ] sunitEnsure: [
   682         " if proceeded in the debugger, we arrive here; "
   682         " if proceeded in the debugger, we arrive here; "
   683         " but still, this is not always a pass !! "
   683         " but still, this is not always a pass !! "
   684         outcome := TestCaseOutcome new.
   684         outcome := TestCaseOutcome new.
   685         outcome testCase: testCase.
   685         outcome testCase: testCase.
   686         outcome result: result.
   686         outcome result: result.
   687         outcome remember.
   687         outcome remember.
   688     ] sunitEnsure: [
       
   689         TestResource resetResources: self resources
   688         TestResource resetResources: self resources
   690     ].
   689     ].
   691 
   690 
   692     "Modified: / 07-07-2011 / 11:10:50 / jv"
   691     "Modified: / 07-07-2011 / 11:10:50 / jv"
   693     "Modified: / 07-07-2011 / 11:34:08 / Jan Vrany <jan.vrant@fit.cvut,cz>"
   692     "Modified: / 07-07-2011 / 11:34:08 / Jan Vrany <jan.vrant@fit.cvut,cz>"
   906 ! !
   905 ! !
   907 
   906 
   908 !TestCase class methodsFor:'documentation'!
   907 !TestCase class methodsFor:'documentation'!
   909 
   908 
   910 version
   909 version
   911     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.99 2013-04-19 09:39:28 cg Exp $'
   910     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.100 2013-04-19 16:00:25 stefan Exp $'
   912 !
   911 !
   913 
   912 
   914 version_CVS
   913 version_CVS
   915     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.99 2013-04-19 09:39:28 cg Exp $'
   914     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.100 2013-04-19 16:00:25 stefan Exp $'
   916 !
   915 !
   917 
   916 
   918 version_SVN
   917 version_SVN
   919     ^ '§Id: TestCase.st 218 2011-06-13 15:45:06Z vranyj1 §'
   918     ^ '§Id: TestCase.st 218 2011-06-13 15:45:06Z vranyj1 §'
   920 ! !
   919 ! !