TestCase.st
changeset 570 c9c4c97948cc
parent 565 0bcfed632d51
child 573 428c2391c132
equal deleted inserted replaced
569:edb941b33667 570:c9c4c97948cc
   854 
   854 
   855     "Modified: / 29-07-2011 / 12:06:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   855     "Modified: / 29-07-2011 / 12:06:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   856 !
   856 !
   857 
   857 
   858 runCase
   858 runCase
       
   859     |didSetup|
       
   860 
   859     self resources do: [:each | each availableFor: self].
   861     self resources do: [:each | each availableFor: self].
   860 
   862 
   861     [
   863     [
       
   864         didSetup := false.
   862         self setUp.
   865         self setUp.
       
   866         didSetup := true.
   863         self performTest.
   867         self performTest.
   864     ] sunitEnsure: [
   868     ] sunitEnsure: [
   865         self tearDown
   869         didSetup ifTrue:[ self tearDown ]
   866     ]
   870     ]
   867 
   871 
   868     "Modified (comment): / 18-08-2011 / 20:35:20 / cg"
   872     "Modified (comment): / 18-08-2011 / 20:35:20 / cg"
   869 !
   873 !
   870 
   874 
   871 runCaseAsFailure
   875 runCaseAsFailure
   872         self setUp.
   876     self setUp.
   873         [[self openDebuggerOnFailingTestMethod] ensure: [self tearDown]] fork
   877     [
       
   878         [self openDebuggerOnFailingTestMethod] ensure: [self tearDown]
       
   879     ] fork
   874 
   880 
   875     "Modified: / 21.6.2000 / 10:04:33 / Sames"
   881     "Modified: / 21.6.2000 / 10:04:33 / Sames"
   876 !
   882 !
   877 
   883 
   878 runCaseAsFailure: aSemaphore
   884 runCaseAsFailure: aSemaphore
   879         [self resources do: [:each | each availableFor: self].
   885     [
   880         [self setUp.
   886         |didSetup|
   881         self openDebuggerOnFailingTestMethod]
   887 
   882                 sunitEnsure: [self tearDown]]
   888         didSetup := false.
   883                         sunitEnsure: [aSemaphore signal].
   889         self resources do: [:each | each availableFor: self].
       
   890         [
       
   891             self setUp.
       
   892             didSetup := true.
       
   893             self openDebuggerOnFailingTestMethod
       
   894         ] sunitEnsure: [
       
   895             didSetup ifTrue:[ self tearDown ]
       
   896         ]
       
   897     ] sunitEnsure: [aSemaphore signal].
   884 !
   898 !
   885 
   899 
   886 setUp
   900 setUp
   887     "can be redefined in a concrete test"
   901     "can be redefined in a concrete test"
   888 !
   902 !
   892 ! !
   906 ! !
   893 
   907 
   894 !TestCase class methodsFor:'documentation'!
   908 !TestCase class methodsFor:'documentation'!
   895 
   909 
   896 version
   910 version
   897     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.97 2013-04-03 13:58:07 cg Exp $'
   911     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.98 2013-04-17 18:42:26 cg Exp $'
   898 !
   912 !
   899 
   913 
   900 version_CVS
   914 version_CVS
   901     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.97 2013-04-03 13:58:07 cg Exp $'
   915     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.98 2013-04-17 18:42:26 cg Exp $'
   902 !
   916 !
   903 
   917 
   904 version_SVN
   918 version_SVN
   905     ^ '§Id: TestCase.st 218 2011-06-13 15:45:06Z vranyj1 §'
   919     ^ '§Id: TestCase.st 218 2011-06-13 15:45:06Z vranyj1 §'
   906 ! !
   920 ! !