RegressionTests__CoverageInstrumentationTest.st
author Claus Gittinger <cg@exept.de>
Thu, 08 Nov 2012 01:10:35 +0100
changeset 746 4ac3ed420d3e
parent 628 b248c1c1fec4
child 747 0b1b5e48be6f
permissions -rw-r--r--
class: RegressionTests::CoverageInstrumentationTest added: #f5: #test_05_instrumentation_loop_count comment/format in: #f3: #f4: changed: #test_01_instrumentation #test_02_instrumentation #test_03_instrumentation #test_04_instrumentation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"{ Package: 'exept:regression' }"
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"{ NameSpace: RegressionTests }"
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
TestCase subclass:#CoverageInstrumentationTest
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
	instanceVariableNames:''
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
	classVariableNames:''
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	poolDictionaries:''
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
	category:'tests-Regression'
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
!
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
!CoverageInstrumentationTest methodsFor:'testFunctions'!
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
f1
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
    ^ 1234
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
!
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
f2:aBoolean
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
    aBoolean ifTrue:[
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
        ^ 1234
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
    ].
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
    ^ 2345
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
f3:aBoolean
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
    aBoolean ifTrue:[
746
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
    28
        ^ 1234  "both should be executed with a true arg, and coverage should see that"
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
    ] ifFalse:[
746
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
    30
        ^ 2345  "bith should be executed with a true arg, and coverage should see that"
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
    ].
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
    ^ 3456
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
!
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
f4:aBoolean
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
    aBoolean ifFalse:[
746
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
    37
        ^ 1234  "should not be executed with a true arg, and coverage should see that"
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
    38
    ].
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
    39
!
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
    40
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
    41
f5:loopCount
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
    42
    1 to:loopCount do:[:i |
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
    43
        1 + 2   "should be executed 10 times, and coverage should see that"
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    ].
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
! !
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
!CoverageInstrumentationTest methodsFor:'tests'!
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
test_01_instrumentation
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    |m1|
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    self class recompile:#f1 usingCompilerClass:InstrumentingCompiler.
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    m1 := (self class compiledMethodAt:#f1).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    self assert:(m1 hasBeenCalled not).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    "/ execute
746
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
    59
    InstrumentationContext runForCoverage:[
628
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
    60
        self f1.
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
    61
    ].
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    self assert:(m1 hasBeenCalled).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    "
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
     self new test_01_instrumentation
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    "
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
!
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
test_02_instrumentation
628
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
    70
    |m2 context|
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    self class recompile:#f2: usingCompilerClass:InstrumentingCompiler.
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    m2 := (self class compiledMethodAt:#f2:).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    self assert:(m2 hasBeenCalled not).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
    self assert:(m2 blockInvocationInfo size == 1).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
    self assert:(m2 statementInvocationInfo size == 1).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    self assert:(m2 blockInvocationInfo conform:[:i | i hasBeenExecuted not]).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    self assert:(m2 statementInvocationInfo conform:[:i | i hasBeenExecuted not]).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    "/ execute
628
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
    83
    context := InstrumentationContext new.
746
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
    84
    context runForCoverage:[
628
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
    85
        self f2:true.
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
    86
    ].
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    self assert:(m2 hasBeenCalled).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
    self assert:(m2 blockInvocationInfo conform:[:i | i hasBeenExecuted]).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
    self assert:(m2 statementInvocationInfo conform:[:i | i hasBeenExecuted not]).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
628
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
    91
    "/ execute in the same context
746
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
    92
    context runForCoverage:[
628
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
    93
        self f2:false.
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
    94
    ].
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    self assert:(m2 hasBeenCalled).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    self assert:(m2 blockInvocationInfo conform:[:i | i hasBeenExecuted]).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
    self assert:(m2 statementInvocationInfo conform:[:i | i hasBeenExecuted]).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
    "
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
     self new test_02_instrumentation
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
    "
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
!
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
test_03_instrumentation
628
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
   106
    |m3 context|
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
    self class recompile:#f3: usingCompilerClass:InstrumentingCompiler.
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
    m3 := (self class compiledMethodAt:#f3:).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
746
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   112
    "/ before execution
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
    self assert:(m3 hasBeenCalled not).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
    self assert:(m3 blockInvocationInfo size == 2).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
    self assert:(m3 statementInvocationInfo size == 1).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
    self assert:(m3 blockInvocationInfo conform:[:i | i hasBeenExecuted not]).
746
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   117
    self assert:(m3 blockInvocationInfo conform:[:i | i count == 0]).
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
    self assert:(m3 statementInvocationInfo conform:[:i | i hasBeenExecuted not]).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
    "/ execute
628
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
   121
    context := InstrumentationContext new.
746
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   122
    context runForCoverage:[
628
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
   123
        self f3:true.
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
   124
    ].
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
746
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   126
    "/ one block should have been invoked, the other not"
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    self assert:(m3 hasBeenCalled).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    self assert:(m3 blockInvocationInfo count:[:i | i hasBeenExecuted]) = 1.
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    self assert:(m3 blockInvocationInfo count:[:i | i hasBeenExecuted not]) = 1.
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
    self assert:(m3 statementInvocationInfo conform:[:i | i hasBeenExecuted not]).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
    "/ execute
746
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   133
    context runForCoverage:[
628
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
   134
        self f3:false.
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
   135
    ].
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
746
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   137
    "/ both blocks should have been invoked"
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    self assert:(m3 hasBeenCalled).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
    self assert:(m3 blockInvocationInfo count:[:i | i hasBeenExecuted]) = 2.
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
    self assert:(m3 blockInvocationInfo count:[:i | i hasBeenExecuted not]) = 0.
746
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   141
    self assert:(m3 blockInvocationInfo conform:[:i | i count == 1]).
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
    self assert:(m3 statementInvocationInfo conform:[:i | i hasBeenExecuted not]).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
    "
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
     self new test_03_instrumentation
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
    "
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
!
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
test_04_instrumentation
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
    |m4|
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
    self class recompile:#f4: usingCompilerClass:InstrumentingCompiler.
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
    m4 := (self class compiledMethodAt:#f4:).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
    self assert:(m4 hasBeenCalled not).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
    self assert:(m4 blockInvocationInfo size == 1).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
    self assert:(m4 statementInvocationInfo size == 0).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
    self assert:(m4 blockInvocationInfo conform:[:i | i hasBeenExecuted not]).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
    self assert:(m4 statementInvocationInfo conform:[:i | i hasBeenExecuted not]).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
    "/ execute
746
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   163
    InstrumentationContext runForCoverage:[
628
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
   164
        self f4:true.
b248c1c1fec4 changed:
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
   165
    ].
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
    self assert:(m4 hasBeenCalled).
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
    "
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
     self new test_04_instrumentation
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
    "
746
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   172
!
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   173
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   174
test_05_instrumentation_loop_count
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   175
    |m5|
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   176
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   177
    self class recompile:#f5: usingCompilerClass:InstrumentingCompiler.
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   178
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   179
    m5 := (self class compiledMethodAt:#f5:).
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   180
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   181
    self assert:(m5 hasBeenCalled not).
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   182
    self assert:(m5 blockInvocationInfo size == 1).
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   183
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   184
    "/ execute
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   185
    InstrumentationContext run:[
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   186
        self f5:10.
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   187
    ].
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   188
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   189
    self assert:(m5 hasBeenCalled).
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   190
    self assert:(m5 blockInvocationInfo first count == 10).
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   191
    self assert:(m5 hasBeenCalled).
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   192
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   193
    "
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   194
     self new test_05_instrumentation
4ac3ed420d3e class: RegressionTests::CoverageInstrumentationTest
Claus Gittinger <cg@exept.de>
parents: 628
diff changeset
   195
    "
567
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
! !
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
!CoverageInstrumentationTest class methodsFor:'documentation'!
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
version_CVS
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
    ^ '$Header$'
e245ebd95922 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
! !