0

I have never used jacoco before.
Using Gradle 4.2
The build uses subprojects
There is subproject "application" and "application.test". The later contains the unit tests.

project(":application.test"){
    apply plugin: 'jacoco'
    // ..
}

The i run gradlew cleanTest test jacocoTestReport
The unit tests are executed as usual.
In application.test/build/reports/jacoco/test/html/index.html i find only an empty table (0 of 0 missed instructions).

I found many hits related to android, but my project is not an eclipse plugin.

fbenoit
  • 3,220
  • 6
  • 21
  • 32
  • By default task `jacocoTestReport` generates report for main classes of module and there is no such classes in your case since they are located in another module, hence report is empty. You need to tweak configuration of this task. – Godin Sep 25 '17 at 23:27
  • with the link to the "instrucment classes ..." the procedure now seems to go further and has an exception while creating the report. So i cannot yet confirm this is solved. – fbenoit Sep 26 '17 at 11:48
  • It has an arrayboundsexception while analyzing a class file. Seems to be an issue with Java8/bytecode and the ASM lib. I have configured to use toolsVersion "0.7.9". Does anyone have a hint? – fbenoit Sep 26 '17 at 11:50
  • 1
    Sounds like https://github.com/jacoco/jacoco/issues/585 that goes down to bug in JDK – Godin Sep 26 '17 at 13:52
  • with the --stacktrace looking at the problematic classes, remove some NonNull to workaround the issue. Now the report is created well. Thank you @Godin. You like to create a answer, so i can mark it as answered? – fbenoit Sep 26 '17 at 15:25
  • The initial question was already marked as duplicate, which makes sense, so no way and no need to write answer ;) And don't see value in spending time on creation of question/answer dedicated to ArrayIndexOutOfBoundsException - it is already very-well described in mentioned ticket in JaCoCo bug-tracker. Maybe as a way to say thanks, if you want, you can simply upvote some of my existing accepted answers in jacoco tag. – Godin Sep 26 '17 at 15:44

0 Answers0