lastState fixes
authorClaus Gittinger <cg@exept.de>
Thu, 08 Nov 2012 01:04:28 +0100
changeset 524 5cf0a462356a
parent 523 dbbf2521cc0c
child 525 a0d7db6472af
lastState fixes
TestCase.st
--- a/TestCase.st	Thu Nov 08 00:04:08 2012 +0100
+++ b/TestCase.st	Thu Nov 08 01:04:28 2012 +0100
@@ -162,8 +162,8 @@
         someOtherOutcome := lastOutcomes at: i.
         someOtherTestCase := someOtherOutcome testCase.
         "/ compare by classes name - in case it got redefined
-        (someOtherTestCase class name = thisTestCase class name
-        and: [someOtherTestCase selector == thisTestCase selector]) ifTrue:[
+        (someOtherTestCase selector == thisTestCase selector
+        and: [someOtherTestCase class name = thisTestCase class name]) ifTrue:[
             "remember; for the timestamp and other info"
             lastOutcomes at: i put: thisOutcome.
             someOtherOutcome result ~= thisOutcome result ifTrue:[
@@ -633,13 +633,27 @@
 
 debug
 
-    | testCase outcome |
+    | testCase outcome result|
 
     [
-        (testCase := self class selector: testSelector) runCase.
+        result := TestResult statePass.
+        [
+            [
+                (testCase := self class selector: testSelector) runCase.
+            ] sunitOn:(TestResult failure) do: [:ex |
+                result := TestResult stateFail.
+                ex reject "/ debug
+            ].
+        ] sunitOn:(TestResult failure) do: [:ex |
+            result := TestResult stateError.
+            ex reject "/ debug
+        ].
+
+        "/ if proceeded in the debugger, we arrive here;
+        "/ but still, this is not always a pass !!
         outcome := TestCaseOutcome new.
         outcome testCase: testCase.
-        outcome result: (TestResult statePass).
+        outcome result: result.
         outcome remember.
     ] sunitEnsure: [
         TestResource resetResources: self resources
@@ -852,11 +866,11 @@
 !TestCase class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.89 2012-11-07 23:04:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.90 2012-11-08 00:04:28 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.89 2012-11-07 23:04:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/sunit/TestCase.st,v 1.90 2012-11-08 00:04:28 cg Exp $'
 !
 
 version_SVN