JaCoCo Command line options

1,058 views
Skip to first unread message

anushre...@gmail.com

unread,
Sep 1, 2016, 8:38:05 AM9/1/16
to JaCoCo and EclEmma Users
Hi,
I want to use JaCoCo with makefile.
Currently I have used JaCoCoagent.jar with source code and got the jacoco.exec.

How do i generate the jacoco coverage report using command line options like emma .
Emma gives simple command line options to generate the reports.
Does Jacoco also support?


Please help


Regards
Anushree

Marc R. Hoffmann

unread,
Sep 1, 2016, 10:24:55 AM9/1/16
to jac...@googlegroups.com
Hi,

JaCoCo does not have a command line tool for report generation. There is

- Ant
- Maven
- API

and various 3rd-party integrations.

Regards,
-marc

anushre...@gmail.com

unread,
Sep 1, 2016, 11:50:57 PM9/1/16
to JaCoCo and EclEmma Users
Thanks Marc for the reply.

I didn't understand API.
So JaCoCo can never be used standalone like Emma for complete Unit testing and Coverage report generation?

rob...@tiendanube.com

unread,
Sep 2, 2016, 1:40:34 PM9/2/16
to JaCoCo and EclEmma Users, anushre...@gmail.com

Anushree,

Some time ago I wrote a general purpose script for easily instrument source folders with JaCoCo. Is a simple bash script and a Ant build file. You can find the files here: https://gist.github.com/andrioli/d7faee5cef5776abe367

Regards

Evgeny Mandrikov

unread,
Sep 2, 2016, 4:06:59 PM9/2/16
to JaCoCo and EclEmma Users, anushre...@gmail.com
API means http://www.eclemma.org/jacoco/trunk/doc/api/index.html so that you can actually create command line tool on your own, even if it is not available out-of-the-box.

bjk...@gmail.com

unread,
Sep 2, 2016, 4:45:04 PM9/2/16
to JaCoCo and EclEmma Users
I think it would be useful if JaCoCo itself provided a command-line tool for viewing/merging exec files and producing reports. Is the JaCoCo team opposed to it, or is it just the case that no one has volunteered the time to do it?

Marc R. Hoffmann

unread,
Sep 5, 2016, 1:53:50 PM9/5/16
to jac...@googlegroups.com
Actually there is a old PR for this:
https://github.com/jacoco/jacoco/pull/86

What was basically missing in the PR was documentation and tests, which
is mandatory for whatever we include in JaCoCo. I like the annotation
based aproach of command line parsing, but this should also be usable to
generate docimentation.

Regards,
-marc

douglas....@gmail.com

unread,
Sep 6, 2016, 6:46:20 AM9/6/16
to JaCoCo and EclEmma Users
Is there no way to run Eclipse functionality from the command line, i.e., by a script file like emacs?

That would perhaps be a workaround that is easier to maintain and acceptable if few people use the command line?

(I tried to post this before, but it seems that failed.)

Marc Hoffmann

unread,
Sep 6, 2016, 10:37:47 AM9/6/16
to jac...@googlegroups.com
Hi,

I don't think Eclipse is scriptable out of the box.

There are projects aiming this (e.g. https://eclipse.org/ease/), but I
have no idea whether this works for EclEmma.

Regards,
-marc

anushre...@gmail.com

unread,
Sep 7, 2016, 2:08:28 AM9/7/16
to JaCoCo and EclEmma Users, anushre...@gmail.com
Hi Evgeny,
Have you tried to generate the report using jacoco Report API?
I have downloaded the jacoco report jar file but not sure how to use it to convert jacoco.exec to coverage report.
I am currently with Android build environment which doesn't use Ant/ Maven.

Thanks
Anushree

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages