-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Maven Mojo to perform offline instrumentation #64
Conversation
Where can we learn how to use Jacoco with offline instrumentation ? I would like to try it on an android project ? |
Version 0.6.2 which supports offline instrumentation is still in development, so things can dramatically change and that's why there is no public and official information on how to do this. But if you want to do some experiments with trunk, then discussion in #58 might be interesting for you. |
I don't feel confortable enough to start from scratch. But if you need someone to test the documentation when it is ready, please notify me. Thx for your work, |
Ok, cool! I'll keep this in mind. |
Conflicts: org.jacoco.doc/docroot/doc/changes.html
@marchof Could you please review those changes? |
@Godin I will have a closer look at it tomorrow! |
<version>4.10</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a important step to provide the agent runtime here. Should we add a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 309ab4c
@Godin I feel like we should add a warning like this to the offline goals (also for the Ant task). The problem is that people migrating from other tools will expect an instrumentation step and might actually use this without any reason.
|
@Godin Minor comment about wording: I used "offline instrumentation" in documentation in lower case, you use upper case spelling. As "on-the-fly" is also lowercase I would prefer the lower case spelling. |
@Godin Is it possible and reasonable to have a single goal 'instrument' which does also the cleanup job? I.e. have this goal bound to two phases by default? |
try { | ||
final FileFilter fileFilter = new FileFilter(this.getIncludes(), | ||
this.getExcludes()); | ||
fileNames = FileUtils.getFileNames(classesDir, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Godin Can we somehow avoid or suppress the Eclipse compiler warning here? I like warning free workspaces ;-)
Type safety: The expression of type List needs unchecked conversion to conform to List
@marchof Not possible to bind the same goal to two phases by default, moreover this separation is required for support of Android. Warning about offline instrumentation looks like a good idea for me - should I add it? The rest has been fixed. |
@Godin Ok, please add the warning to the Maven goals, I'll add it to the Ant task on master. |
@marchof Warning has been added, so can I merge? |
@Godin Go for it ;-) |
* Performs offline instrumentation. Note that after execution of test you must | ||
* restore original classes with help of "restore-instrumented-classes" goal. | ||
* <p> | ||
* <b>Warning:</b> The preferred way for code coverage analysis with JaCoCo is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Godin Either we use the "strong" tag here or we need to extend the stylesheet. Currently the "b" markup gets lost.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marchof Indeed - I'll change on "strong".
Add Maven Mojos to perform offline instrumentation
HI @Godin , this thread is a bit old now but your experiment with android helped me a lot to set up a unified code coverage for both robolectric and standard junit tests and get it displayed in a sonar dash board. (see the Jacoco profile here : https://github.com/stephanenicolas/Quality-Tools-for-Android/blob/)
I have been dreaming about that for almost a year now. Thanks a lot for offline instrumentation via jacoco :) Do you think it would be possible to give better names to the test suites inside the widget, and even to add more test suites ? For instance I would like to add UI testing (black box testing) or monkey testing. |
Hi @stephanenicolas , No need to write the same in several topics. We are glad to hear that our work is useful for you. What do you mean by "widget" ? If this is about Sonar, then this is not an appropriate place to discuss this. |
Hi Evgeny, you're right, I have been over enthusiastic about this :) By widget, I meant the Sonar widget, so you're right again, that's not the Stéphane 2013/3/24 Evgeny Mandrikov notifications@github.com
Stéphane NICOLAS, |
Is offline instrumentation supposed to work for android with latest release It looks like : is not working anymore with latest jacoco release. They only worked with Stéphane |
@stephanenicolas It supposed to work, because there is no major changes on Maven Plugin side regarding this. In any case I suggest you to switch to Users Mailing List with better explanation of your problem. |
No description provided.