-
Notifications
You must be signed in to change notification settings - Fork 36
Can't recognize classes that have been pack200'd #49
Comments
Indeed it is a known issue that Pack200 modifies class files, which is an issue for example for JAR signing: http://docs.oracle.com/javase/1.5.0/docs/guide/deployment/deployment-guide/pack200.html The only solution I can think about is to add direct support for Pack200 to the JaCoCo analyzer. If both your program under test and the JaCoCo analyzer will read the Pack200 JAR they should see the same class files. This would require to run the analysis on the Pack200 JAR, not on the class files. If this is a solution for you, please open an issue for the JaCoCo project to support Pack200 format for analysis. |
On 03/19/2013 10:19 PM, Marc R. Hoffmann wrote:
|
Unfortunetelly it is not: If the class gets modified for any reason (Pack200, AspectJ, Mocking Frameworks, ...) JaCoCo will miserable fail or produce random results. |
This issue has been transferred to jacoco/jacoco#91 |
I got another occurrence of this issue and it leads me to further questions: |
When you import a exec file into Eclipse the classes at runtime have to be the same class files then the ones compiled by Eclipse. Unfortunately there can be a couple of reasons why the class files might differ:
|
On 01/08/2014 01:05 AM, Marc R. Hoffmann wrote:
|
@mickaelistria Nice idea, can you please open a feature request for this? |
Here is the feature request: #74 |
When using classes coming from jars that have been pack200'd, later reports (may them be provided by Ant or EclEmma) don't succeed to map the class found in jacoco.exec with classes part of the pack200'ed jars; and then report 0% coverage on those classes.
How to reproduce:
cd api; mvn verify
will build a p2 update-sitecd client; mvn verify
will consume a dependency from this p2 site and will run a testapi/org.jboss.tools.example.api
into Eclipse (as a Maven project), import coverage session fromclient/target/jacoco.exec
with EcliEmmacd api; mvn clean verify -Ppack200
will generate a p2 repo including pack200'ed jarcd client; mvn verify
; will re-run test, but will resolve to the packed bundle instead of plain jarYou can make the same experiment with Ant, or Jenkins Jacoco plugin instead of EclEmma.
The content of the jacoco.exec file looks good, but something (class id?) is changed and prevent reports for matching source/class files with what's found in the jacoco.exec.
The text was updated successfully, but these errors were encountered: