Improvements in coverage - exclude accessors and metadata methods.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 28 Jun 2013 03:54:52 +0200
changeset 186 b53f4cc947e1
parent 185 f1415a086e05
child 187 ee2471c56070
Improvements in coverage - exclude accessors and metadata methods.
reports/Builder__CoverageReportFormat.st
--- a/reports/Builder__CoverageReportFormat.st	Fri Jun 28 03:54:44 2013 +0200
+++ b/reports/Builder__CoverageReportFormat.st	Fri Jun 28 03:54:52 2013 +0200
@@ -83,7 +83,7 @@
     instrumentedMethods do:[:method|
         | classMap methodSet |
         classMap := packageMap at: method package ifAbsentPut: [ Dictionary new ].
-        methodSet := classMap at: method mclass ifAbsentPut: [ Set new ].
+        methodSet := classMap at: method mclass theNonMetaclass ifAbsentPut: [ Set new ].
         methodSet add: method.
     ].
 
@@ -107,7 +107,7 @@
     ]
 
     "Created: / 25-06-2013 / 13:17:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 27-06-2013 / 11:56:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 28-06-2013 / 01:57:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 writeClass: class with: content
@@ -176,13 +176,18 @@
 
 writeMethod: method
 
-    | info firstCharOffset firstLineNr lastLineNr lines  |
+    | info firstCharOffset firstLineNr lastLineNr lines name |
 
-    stream nextPutAll:'        <method name="'; nextPutAll: method selector; nextPutLine: '" signature="" line-rate="1.0" branch-rate="1.0" complexity="1.0">'.
+    name := method selector.
+    method mclass isMetaclass ifTrue:[
+        name := name , ' [class method]'.
+    ].
+
+    stream nextPutAll:'        <method name="'; nextPutAll: name; nextPutLine: '" signature="" line-rate="1.0" branch-rate="1.0" complexity="1.0">'.
     stream nextPutLine:'          <lines>'.
     currentMethod := method.
 
-    info := infos at: method mclass ifAbsentPut:[ReportSourceInfo for: method mclass].
+    info := infos at: method mclass theNonMetaclass ifAbsentPut:[ReportSourceInfo for: method mclass theNonMetaclass].
     firstCharOffset := info offsetOfMethod: method.
     firstLineNr := (info lineAndColumnOfOffset: firstCharOffset) x.
     lastLineNr := (info lineAndColumnOfOffset: firstCharOffset + method source size) x.
@@ -210,21 +215,7 @@
     stream nextPutLine:'        </method>'
 
     "Created: / 25-06-2013 / 13:17:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 27-06-2013 / 00:04:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-writeMethod: method with: content
-
-    stream nextPutLine:'        <method name="'; nextPutAll: method selector; nextPutAll: '" signature="" line-rate="1.0" branch-rate="1.0" complexity="1.0">'.
-    stream nextPutLine:'          <lines>'.
-    currentMethod := method.
-    content value.          
-    currentMethod := nil.
-    stream nextPutLine:'          </lines>'.
-    stream nextPutLine:'        </method>'
-
-    "Created: / 25-06-2013 / 12:59:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 26-06-2013 / 18:22:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 28-06-2013 / 01:59:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 writePackage: packageName with: aBlock