Hi Kallesh,

Yes, It works in Linux.

You can try below stuff, for sure it will work.

Using examples that come with Tomcat as following:



java -version



openjdk version "11.0.1" 2018-10-16

OpenJDK Runtime Environment 18.9 (build 11.0.1+13)

OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)



mkdir /tmp/j

cd /tmp/j



wget "http://repo1.maven.org/maven2/org/jacoco/jacoco/0.8.3/jacoco-0.8.3.zip
"

aunpack jacoco-0.8.3.zip



wget "
https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.29/bin/apache-tomcat-8.5.29.tar.gz
"

aunpack apache-tomcat-8.5.29.tar.gz



cat <<END >./apache-tomcat-8.5.29/bin/setenv.sh

CATALINA_OPTS="\${CATALINA_OPTS}
-javaagent:/tmp/j/jacoco-0.8.3/lib/jacocoagent.jar=destfile=/tmp/j/jacoco.exec"

END



./apache-tomcat-8.5.29/bin/catalina.sh start



curl http://localhost:8080/examples/servlets/servlet/HelloWorldExample



./apache-tomcat-8.5.29/bin/catalina.sh stop 60



I just got non zero file:



ls -l jacoco.exec



-rw-r----- 1 evgeny.mandrikov wheel 38463 Mar  7 20:53 jacoco.exec



That includes information about execution of HelloWorldExample :



java -jar jacoco-0.8.3/lib/jacococli.jar execinfo jacoco.exec | grep
HelloWorldExample



f4baf7db7add6fb6   19 of  19   HelloWorldExample



Among many other class files:



java -jar jacoco-0.8.3/lib/jacococli.jar execinfo jacoco.exec | wc -l



703



And got following report:



java -jar jacoco-0.8.3/lib/jacococli.jar report jacoco.exec --classfiles
apache-tomcat-8.5.29/webapps/examples/WEB-INF/classes/ --html report


Thanks & Regards,
Jitendra Kumar


On Thu, Sep 5, 2019 at 4:33 PM Kallesh Kallu <[email protected]>
wrote:

> Hi,
> i am trying to get code coverage of my Java Test code in a Linux
> environment , Does Jacoco support linux environment ? if supported then
> what will be the output?
>
> Regards,
> Kallesh K
>
> --
> You received this message because you are subscribed to the Google Groups
> "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/c9daf288-183e-4d26-b628-c7feefdf3846%40googlegroups.com
> <https://groups.google.com/d/msgid/jacoco/c9daf288-183e-4d26-b628-c7feefdf3846%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/CAGLVXHOK7AW94jbOE%3DKSeEMV0ZrW%2BUhtBHy_%3DA8dZ9eyuvAsGQ%40mail.gmail.com.

Reply via email to