--- a/reports/Builder__CoverageReport.st Thu Mar 12 22:22:35 2015 +0100
+++ b/reports/Builder__CoverageReport.st Fri Apr 17 17:17:05 2015 +0200
@@ -120,7 +120,7 @@
version methods, printOn: and so on are exluded. Also, testcases
and test resources are ommited"
- | mclass mselector parser tree pkgdef |
+ | mclass mselector tree pkgdef |
mclass := aMethod mclass.
mselector := aMethod selector.
@@ -142,35 +142,29 @@
) includes: mselector) ifTrue:[ ^ true ].
].
- tree := (parser := Parser parseMethod: aMethod source in: mclass) tree.
+ tree := (Parser parseMethod: aMethod source in: mclass) tree.
tree isNil ifTrue:[ ^ true ]. "/ empty method?
(tree isStatement and:[tree isReturnNode not and:[tree nextStatement isNil]]) ifTrue:[
tree := tree expression.
].
"/ Exclude all getters/return constants...
- (aMethod numArgs == 0 and:[tree isReturnNode and:[tree expression isVariable or:[tree expression isConstant]]]) ifTrue:[ ^ true ].
+ (aMethod numArgs == 0
+ and:[tree isReturnNode
+ and:[tree expression isVariable or:[tree expression isConstant]]]) ifTrue:[ ^ true ].
"/ Exclude all setters
(aMethod numArgs == 1
and:[tree isAssignment
- and:[tree variable type == #InstanceVariable
+ and:[(tree variable isInstanceVariable or:[tree variable isClassVariable])
and:[tree expression isVariable
- and:[tree expression type == #MethodArg]]]]) ifTrue:[ ^ true ].
+ and:[tree expression isMethodArg]]]]) ifTrue:[ ^ true ].
pkgdef := ProjectDefinition definitionClassForPackage: aMethod package.
pkgdef notNil ifTrue:[
- "/ Use perform: because eXept HEAD does not have excludedFromCoverage...
- (pkgdef perform:#excludedFromCoverage ifNotUnderstood:[#()]) do:[:spec|
- spec isArray ifTrue:[
- (spec first = mclass name and:[spec second == mselector]) ifTrue:[ ^ true ].
- ].
- spec = mclass name ifTrue:[ ^ true ].
- ].
- "/ Use perform: because eXept HEAD does not have excludedFromCoverage:...
- (pkgdef perform:#excludedFromCoverage: with: aMethod ifNotUnderstood:[false]) ifTrue:[ ^ true ].
+ ^ pkgdef excludedFromCoverage:aMethod.
].
- ^false
+ ^ false
"Created: / 28-06-2013 / 02:20:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified (comment): / 28-06-2013 / 11:31:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"