diff --git a/Makefile b/Makefile index 7bf8744f..6b623273 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,10 @@ test-nextflow: clean nextflow-git compile check #coverage test-all: clean compile-all check #coverage +coverage: + ./gradlew jacocoTestReport + open plugins/nf-quilt/build/reports/jacoco/test/html/index.html + # # Create packages # diff --git a/build.gradle b/build.gradle index 2a90a7f6..c1c69b13 100644 --- a/build.gradle +++ b/build.gradle @@ -21,6 +21,7 @@ plugins { id 'idea' id 'se.patrikerdes.use-latest-versions' version '0.2.18' id 'com.github.ben-manes.versions' version '0.51.0' + id 'jacoco' } // Add ability to test with upcoming versions of Groovy @@ -62,6 +63,7 @@ allprojects { apply plugin: 'idea' apply plugin: 'groovy' apply plugin: 'java-library' + apply plugin: 'jacoco' java { toolchain { @@ -116,6 +118,19 @@ allprojects { useJUnitPlatform() } + jacoco { + toolVersion = '0.8.12' + reportsDirectory = layout.buildDirectory.dir('reports/jacoco') + } + + jacocoTestReport { + reports { + xml.required = true + csv.required = true + html.required = true + } + } + // this is required due to this IDEA bug // https://youtrack.jetbrains.com/issue/IDEA-129282 sourceSets { diff --git a/plugins/nf-quilt/build.gradle b/plugins/nf-quilt/build.gradle index 840650a2..0514ba46 100644 --- a/plugins/nf-quilt/build.gradle +++ b/plugins/nf-quilt/build.gradle @@ -20,6 +20,7 @@ plugins { id 'idea' id 'se.patrikerdes.use-latest-versions' version '0.2.18' id 'com.github.ben-manes.versions' version '0.51.0' + id 'jacoco' } useLatestVersions { @@ -115,3 +116,11 @@ test { useJUnitPlatform() } +jacocoTestReport { + reports { + xml.required = true + csv.required = true + html.required = true + } +} +