Questions tagged [jacoco]

JaCoCo a coverage analysis tool. It runs as a JVM Agent and therefore does not require offline instrumentation.

JaCoCo is an EPL-licensed, open-source code coverage analysis tool. It runs as a JVM Agent and therefore does not require offline instrumentation.

Compared to Cobertura, it has lower runtime overhead but less precision. It is unable to record hit counts, it only records red/green, however it can show coverage on class, method, line, complexity, branch and instruction level. It also has the ability to merge the results of multiple analyses when generating a report.

QuickLinks:

Related Tags:

JaCoCo is the successor of the EclEmma Eclipse plugin for the Emma coverage tool. If a search through -tagged questions doesn't help, try searching for the tag.

The tag is used for general topics related to code coverage measurement.

1891 questions
13
votes
1 answer

Android Studio 3.0 gradle 3.0.0-beta2, breaks Kotlin Unit Test Coverage?

I have a simple Kotlin classes, as below class MyClass { fun justSayHello(yes: Boolean): String { if (yes) { return "Hello" } else { return "Sorry" } } } I have my test (written in Java here,…
Elye
  • 53,639
  • 54
  • 212
  • 474
13
votes
1 answer

Property 'sonar.jacoco.reportPath' is deprecated. Please use 'sonar.jacoco.reportPaths' instead

Property 'sonar.jacoco.reportPath' is deprecated. Please use 'sonar.jacoco.reportPaths' instead. I keep getting this message when running SonarQube through Gradle and the phrase "reportPath" does not even appear even once in the entire…
Andrew Chen
  • 325
  • 1
  • 3
  • 9
13
votes
4 answers

Is there a way to get unit coverage percentage (eg from jacoco) on only new code?

My hypothethical scenario is this: I have run my junit tests and generated a jacoco file my git diff shows I have changed 10 lines of code Now the intersection of my git diff and the jacoco information is that 7 of the 10 lines of code changed are…
hawkeye
  • 34,745
  • 30
  • 150
  • 304
13
votes
2 answers

How to get code coverage reports from google Firebase for Android Espresso tests

Based on this documentation - https://developer.android.com/studio/test/command-line.html#AMOptionsSyntax it is possible to get code coverage results back from Firebase lab. Some folks in #test-lab at firebase-community.slack.com are able to get it…
satyajit
  • 1,470
  • 3
  • 22
  • 43
12
votes
1 answer

JaCoCo test coverage: How to exclude a class inside jar from report?

In JBoss AS 7 integration testsuite, we use JaCoCo for code coverage. I have the execution data already. Now when generating the report, I get "Can't add different class with same name: ..." So I have to exclude some jars.
Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277
12
votes
1 answer

Kotlin JaCoCo - IllegalClassFormatException. Please supply original non-instrumented classes

I'm trying to get test coverage report of our Android application module and executing the testVariantBuildTypeUnitTest task. Although all tests are passed, TEST-classNameTest.xml file contains error message below. This error is only given for…
tugceaktepe
  • 195
  • 1
  • 2
  • 17
12
votes
1 answer

Jacoco:: coverage percentage to print on console

After running mvn jacoco:report how can We print coverage percentage on console ? I can see it in browser but want it to print in jenkins.
niraj.nijju
  • 616
  • 1
  • 8
  • 17
12
votes
2 answers

Gradle: could not set unknown property 'classDumpFile' in Intellij

I have been searching through the Internet and asking on irc chats but none of them were or did not give any answer for trying to solve my problem. I am trying to make my project to use JaCoCo on Intellij IDE, the tests are going to be done in a…
Oscar Reyes
  • 4,223
  • 8
  • 41
  • 75
12
votes
3 answers

Remove some java files from jacoco test coverage using gradle

I want to exclude some source files in Jacaco Test coverage report.For other generated code I have done like this: classDirectories = fileTree( dir: "${project.buildDir}/intermediates/classes/debug/com", excludes: [ …
Shubham
  • 2,627
  • 3
  • 20
  • 36
12
votes
4 answers

Jacoco offline instrumentation Gradle script

I tried looking for Jacoco offline instrumentation gradle script snippets but couldn't find one. Is it possible to do Jacoco offline instrumentation through gradle scripts ? If yes...An example of it would be greats. Thanks.
karthik
  • 773
  • 2
  • 11
  • 19
12
votes
2 answers

Maven Jacoco Configuration for multi-module projects

I was trying to generate code coverage reports using jacoco plugin in maven for a multi module project that I was working on. I added the following in my parent pom.xml within the build tags. org.jacoco
John
  • 2,445
  • 2
  • 17
  • 25
12
votes
5 answers

Gradle jacoco coverage report with more than one submodule(s)?

Does anybody know how to configure a gradle file for java jacoco report that contain codecoverage of more than one gradle submodule? my current approach only shows codecoverage of the current submodule but not codecoverage of a sibling-submodul. I…
k3b
  • 14,517
  • 7
  • 53
  • 85
11
votes
2 answers

JaCoCo does not show the source files in the HTML coverage report for multi projects

I'm using PDE and in my build.xml I compile my code and try to create a coverage report using JaCoCo and JUnit. I noticed that it does now show the sourcefile, even though I added sourcefiles section in the structure section of jacoco:report. In…
vesii
  • 2,760
  • 4
  • 25
  • 71
11
votes
0 answers

Jacoco Kotlin Data classes filter getters and setters?

So after updating to Jacoco 0.8.2 my data class code coverage improved greatly because it now filters out most of the generated functions, "equals", "hashcode", etc... However, it still is looking for tests for all of the getters and setters that…
Kyle
  • 1,430
  • 1
  • 11
  • 34
11
votes
3 answers

Jacoco: Find code coverage for external tests

I recently used EclEmma plugin in eclipse to find code coverage of JUnits in my application and it worked great. In the next step, I want to be able to find code coverage for end-to-end tests / functional tests which are called on our application…
tryingToLearn
  • 10,691
  • 12
  • 80
  • 114