Generate code coverage for sources contained in a JAR

85 views
Skip to first unread message

Stefan Lecho

unread,
Jan 15, 2013, 8:47:39 AM1/15/13
to jac...@googlegroups.com
Hi,

I would like to generate code coverage reports for sources that are contained in a JAR file.

My integration tests for my swing application are executed with the Robot Framework (http://code.google.com/p/robotframework/) and the aid of their Maven plugin (http://code.google.com/p/robotframework-maven-plugin/). These integration tests are contained in Project1. This project has a dependency to the JAR of Project2, which contains the source code of my swing application.

By running my integration tests, which are contained in Project1, I would like to generate code coverage for the sources contained in Project2.

Is there a way generate a Project2.jar that contains the required jacoco.exec to generate code coverage for Project2 or are there other options to implement this requirement ?

Regards, Stefan Lecho.

Marc Hoffmann

unread,
Jan 15, 2013, 10:09:33 AM1/15/13
to jac...@googlegroups.com
Hi Stefan,

how do you create the report for Project2? If you use Maven you can set
the "dataFile" property of the report goal in Project2 to the location
of your *.exec file (probably located in Project1).

Cheers,
-marc

http://www.eclemma.org/jacoco/trunk/doc/report-mojo.html#dataFile

On 2013-01-15 14:47, Stefan Lecho wrote:
> Hi,
>
> I would like to generate code coverage reports for sources that are
> contained in a JAR file.
>
> My integration tests for my swing application are executed with the
> Robot Framework (http://code.google.com/p/robotframework/) and the
> aid
> of their Maven plugin
> (http://code.google.com/p/robotframework-maven-plugin/). These
> integration tests are contained in _Project1_. This project has a
> dependency to the JAR of _Project2_, which contains the source code
> of
> my swing application.
>
> By running my integration tests, which are contained in _Project1_, I
> would like to generate code coverage for the sources contained in
> _Project2_.
>
> Is there a way generate a _Project2.jar_ that contains the required
> jacoco.exec to generate code coverage for Project2 or are there other
> options to implement this requirement ?
>
> Regards, Stefan Lecho.
>
> --

Stefan Lecho

unread,
Jan 15, 2013, 11:37:18 AM1/15/13
to jac...@googlegroups.com
How can I specify (in my project1 pom.xml) the dataFile of project2, without hard-coding the location of the exec file ?
Can this exec file be packaged in the project2.jar which is defined as a dependency of project1 ?
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages