mardi 3 mars 2015

Jacoco Coverage Report of DSL



I am writing a customer Jacoco coverage report of my DSL file. Here is what I did -


1> get analyzing data (similar to http://ift.tt/1DRMIJg)


2> generate the report (similar to http://ift.tt/1wWhFsz).


Now, the differences for me are: I created SMAP file (following JSR-045) and attached the file to the class file as SourceDebugExtention. I could not independently verify this step is successful - except that, on the Eclipse debugger, it looks differently and looks like working. However, the debugger could not load my text file and I could not really tell if it is successful.


Now, I am expecting that after analyzing, I get a report of DSL coverage. What I found is, if I merge the data with Java file, it looks perfectly matching. But if I merge the data with DSL file, it does not match at all. It seems the "SourceDebugExtension" is not turned on. Looking at the code, the problem seems org.jacoco.core.analysis.Analyzer class -



public void analyzeClass(final ClassReader reader) {
final ClassVisitor visitor = createAnalyzingVisitor(
CRC64.checksum(reader.b), reader.getClassName());
reader.accept(visitor, 0);
}


It seems I should change read.accept line to add Attribute. Any suggestion? Thanks.




Aucun commentaire:

Enregistrer un commentaire