TestCase.st
changeset 32 77f76ea3a7ef
parent 27 a36d465d164c
child 35 243e56eed6ca
equal deleted inserted replaced
31:5ac2aafeac47 32:77f76ea3a7ef
    39 	^self new setTestSelector: aSymbol
    39 	^self new setTestSelector: aSymbol
    40 !
    40 !
    41 
    41 
    42 suite
    42 suite
    43         | testSelectors result |
    43         | testSelectors result |
    44         testSelectors := self sunitSelectors select: [:each | 'test*' sunitMatch: each].
    44         testSelectors := self sunitSelectors select: [:each | 'test*' match: each].
    45         testSelectors sort.
    45         testSelectors sort.
    46         result := TestSuite new.
    46         result := TestSuite new.
    47         testSelectors do: [:each | result addTest: (self selector: each)].
    47         testSelectors do: [:each | result addTest: (self selector: each)].
    48         ^result
    48         ^result
    49 
    49 
   169         "SUnit has halted one step in front of the failing test method. 
   169         "SUnit has halted one step in front of the failing test method. 
   170         Step over the 'self halt' and send into 'self perform: testSelector' 
   170         Step over the 'self halt' and send into 'self perform: testSelector' 
   171         to see the failure from the beginning"
   171         to see the failure from the beginning"
   172 
   172 
   173         "/ self halt.
   173         "/ self halt.
   174         self perform: testSelector sunitAsSymbol
   174         self perform: testSelector asSymbol
   175 
   175 
   176     "Modified: / 21.6.2000 / 10:03:37 / Sames"
   176     "Modified: / 21.6.2000 / 10:03:37 / Sames"
   177 !
   177 !
   178 
   178 
   179 run
   179 run
   186 run: aResult
   186 run: aResult
   187 	aResult runCase: self
   187 	aResult runCase: self
   188 !
   188 !
   189 
   189 
   190 runCase
   190 runCase
   191 	self setUp.
   191         self setUp.
   192 	[self perform: testSelector sunitAsSymbol] sunitEnsure: [self tearDown]
   192         [self perform: testSelector asSymbol] valueNowOrOnUnwindDo: [self tearDown]
   193 
   193 
   194     "Modified: / 21.6.2000 / 10:04:18 / Sames"
   194     "Modified: / 21.6.2000 / 10:04:18 / Sames"
   195 !
   195 !
   196 
   196 
   197 runCaseAsFailure
   197 runCaseAsFailure
   198 	self setUp.
   198         self setUp.
   199 	[[self openDebuggerOnFailingTestMethod] sunitEnsure: [self tearDown]] fork
   199         [[self openDebuggerOnFailingTestMethod] valueNowOrOnUnwindDo: [self tearDown]] fork
   200 
   200 
   201     "Modified: / 21.6.2000 / 10:04:33 / Sames"
   201     "Modified: / 21.6.2000 / 10:04:33 / Sames"
   202 !
   202 !
   203 
   203 
   204 setUp
   204 setUp
   208 ! !
   208 ! !
   209 
   209 
   210 !TestCase class methodsFor:'documentation'!
   210 !TestCase class methodsFor:'documentation'!
   211 
   211 
   212 version
   212 version
   213     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.11 2001-08-23 20:57:05 cg Exp $'
   213     ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.12 2001-09-04 13:07:08 cg Exp $'
   214 ! !
   214 ! !
   215 TestCase initialize!
   215 TestCase initialize!