changed:
authorClaus Gittinger <cg@exept.de>
Tue, 09 Aug 2011 23:28:07 +0200
changeset 628 b248c1c1fec4
parent 627 d0e1dfc868ae
child 629 0745835dd030
changed: #test_01_instrumentation #test_02_instrumentation #test_03_instrumentation #test_04_instrumentation
RegressionTests__CoverageInstrumentationTest.st
--- a/RegressionTests__CoverageInstrumentationTest.st	Tue Aug 09 23:12:28 2011 +0200
+++ b/RegressionTests__CoverageInstrumentationTest.st	Tue Aug 09 23:28:07 2011 +0200
@@ -50,8 +50,9 @@
     self assert:(m1 hasBeenCalled not).
 
     "/ execute
-    self f1.
-
+    InstrumentationContext run:[
+        self f1.
+    ].
     self assert:(m1 hasBeenCalled).
 
     "
@@ -60,7 +61,7 @@
 !
 
 test_02_instrumentation
-    |m2 |
+    |m2 context|
 
     self class recompile:#f2: usingCompilerClass:InstrumentingCompiler.
 
@@ -73,14 +74,18 @@
     self assert:(m2 statementInvocationInfo conform:[:i | i hasBeenExecuted not]).
 
     "/ execute
-    self f2:true.
-
+    context := InstrumentationContext new.
+    context run:[
+        self f2:true.
+    ].
     self assert:(m2 hasBeenCalled).
     self assert:(m2 blockInvocationInfo conform:[:i | i hasBeenExecuted]).
     self assert:(m2 statementInvocationInfo conform:[:i | i hasBeenExecuted not]).
 
-    "/ execute
-    self f2:false.
+    "/ execute in the same context
+    context run:[
+        self f2:false.
+    ].
 
     self assert:(m2 hasBeenCalled).
     self assert:(m2 blockInvocationInfo conform:[:i | i hasBeenExecuted]).
@@ -92,7 +97,7 @@
 !
 
 test_03_instrumentation
-    |m3|
+    |m3 context|
 
     self class recompile:#f3: usingCompilerClass:InstrumentingCompiler.
 
@@ -105,7 +110,10 @@
     self assert:(m3 statementInvocationInfo conform:[:i | i hasBeenExecuted not]).
 
     "/ execute
-    self f3:true.
+    context := InstrumentationContext new.
+    context run:[
+        self f3:true.
+    ].
 
     self assert:(m3 hasBeenCalled).
     self assert:(m3 blockInvocationInfo count:[:i | i hasBeenExecuted]) = 1.
@@ -113,7 +121,9 @@
     self assert:(m3 statementInvocationInfo conform:[:i | i hasBeenExecuted not]).
 
     "/ execute
-    self f3:false.
+    context run:[
+        self f3:false.
+    ].
 
     self assert:(m3 hasBeenCalled).
     self assert:(m3 blockInvocationInfo count:[:i | i hasBeenExecuted]) = 2.
@@ -139,7 +149,9 @@
     self assert:(m4 statementInvocationInfo conform:[:i | i hasBeenExecuted not]).
 
     "/ execute
-    self f4:true.
+    InstrumentationContext run:[
+        self f4:true.
+    ].
 
     self assert:(m4 hasBeenCalled).