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
30
votes
2 answers

How to make Maven unit test code coverage work

In Eclipse, I have used EcLEmma to see the unit test code coverage. Which worked fine. Therefore I have tried to use the JaCoCo plugin for Maven to see the same report with Surefire from Maven build, or even better, with a certain profile, or in the…
user3732793
  • 1,699
  • 4
  • 24
  • 53
30
votes
6 answers

JaCoCo not generating jacoco.exec until after skipping JaCoCo execution

I'm having trouble generating AHP reports via JaCoCo in one of my modules. When the build starts, I see JaCoCo correctly setting argLine with: [INFO] jacoco.agent.argLine set to…
pushit real
  • 501
  • 1
  • 6
  • 12
29
votes
3 answers

How to exclude Dagger2 classes from test coverage

Is there any option to exclude Dagger2 classes from test coverage report in Android Studio
Mladen Rakonjac
  • 9,562
  • 7
  • 42
  • 55
29
votes
5 answers

Jacoco Code Coverage in android studio

I am trying to generate Jacoco code coverage report. I have used AndroidTestCase for my test classes. I have found using testCoverageEnabled true and using default android -studio default jacoco, ./gradlew connectedCheck or…
user1365169
  • 383
  • 1
  • 3
  • 10
29
votes
2 answers

How to calculate code coverage of selenium tests with respect to web application code

I have a requirement to capture the code coverage of my selenium tests to the amount of source code in the server code (web application source code) covered . For example the tests for login functionality should capture the amount of code covered …
Vigneshwaran
  • 475
  • 3
  • 8
  • 15
28
votes
1 answer

Gradle 6.0 deprecation warning for JacocoReport configuration

The following Gradle task, which configures JacocoReportBase: task jacocoRootReport(type: JacocoReport) { ... sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs) additionalSourceDirs =…
Martin Zeitler
  • 1
  • 19
  • 155
  • 216
27
votes
4 answers

How to skip jacoco coverage check during build?

In our project we use jacoco-maven-plugin and during the build I get this error: [ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.5:check (jacoco-check) on project my-project: Coverage checks have not been met. See log for details.…
IKo
  • 4,998
  • 8
  • 34
  • 54
27
votes
8 answers

JaCoCo with IntelliJ

So this question might not be really specific, but i'm asking it anyway. I'm trying to use JaCoCo with IntelliJ to gather coverage reports on unit tests. However, i don't have any experience whatsoever to set this up. In Netbeans you just have to…
Ixbitz
  • 427
  • 1
  • 5
  • 7
27
votes
3 answers

Exclude folder in jacoco coverage report

In my java project I have generated classes which are inside the same package folder as the other classes. I would like to configure jacoco maven plugin to exclude those generated classes and only use classes in the main/src/java folder (not…
troger19
  • 327
  • 1
  • 4
  • 8
27
votes
2 answers

JaCoCo report generation using maven

I have captured the coverage details in a jacoco.exec file. It is 6Mb in size. I need to generate a coverage report using maven . I tried the below org.jacoco
user1226320
  • 413
  • 1
  • 4
  • 11
26
votes
2 answers

Sonar Jacoco for Kotlin Setup not generating code coverage

I'm trying to do Sonar Setup with Jacoco for Kotlin to generate Code Coverage report but it's not showing any code coverage. While checking Sonar Console it showing following error. Anyone has faced this issue before, any suggestion what could be…
CoDe
  • 11,056
  • 14
  • 90
  • 197
26
votes
4 answers

Plugin with id 'org.sonarqube' not found

I am trying to implement sonar with gradle for code-coverage measure for my project. we are using gradle-4.0.1 and sonarqube-6.4 . when I run gradle sonarqube from command line I get this error- Plugin with id 'org.sonarqube' not found. I tried…
Deepak S
  • 1,544
  • 3
  • 15
  • 33
26
votes
1 answer

Why is JaCoCo not covering my String switch statements?

I have a switch statement that extracts an addressing mode from a String and I've written unit tests to cover, what I thought was every eventuality but JaCoCo seems to skip my switch statements, resulting in lower coverage. Why, if all my case…
Ross Drew
  • 8,163
  • 2
  • 41
  • 53
26
votes
6 answers

JaCoCo doesn't work with Robolectric tests

I wanted to generate code coverage reports on my JUnit tests in my android project so I added the JaCoCo gradle plugin. This is my project level build.gradle file: apply plugin: 'jacoco' buildscript { repositories { jcenter() } …
Longi
  • 3,913
  • 2
  • 28
  • 38
26
votes
3 answers

java.lang.VerifyError when running Android tests with testCoverageEnabled = true

I've recently tried the new Jacoco code coverage feature for Android Gradle plugin, and unfortunately it makes my tests fail with the following error: java.lang.VerifyError: com/foo/bar/rest/SomeClass at …
Egor
  • 39,695
  • 10
  • 113
  • 130