JaCoCo

Java Code Coverage (JaCoCo) is a well-known tool for measuring test coverage.
To use it in our project, we need to add a few lines to our Gradle configuration file, that is, build.gradle:

  1. Add the Gradle plugin for JaCoCo:
apply plugin: 'jacoco'
  1. To see the JaCoCo results, run the following from your command prompt:
gradle test jacocoTestReport
  1. The same Gradle tasks can be run from the Gradle Tasks IDEA Tool Window.
  2. The end result is stored in the build/reports/jacoco/test/html directory. It's an HTML file that can be opened in any browser:

Further chapters of this book will explore code coverage in more detail. Until then, go to http://www.eclemma.org/jacoco/ for more information.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.19.75