Skip to content

Commit

Permalink
update Jacoco configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
osiegmar committed Nov 19, 2023
1 parent 5fb4465 commit f4402df
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ dependencies {

tasks.test {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport)
}

val intTestTask = tasks.register<Test>("intTest") {
Expand All @@ -73,12 +72,11 @@ val intTestTask = tasks.register<Test>("intTest") {
testClassesDirs = intTest.output.classesDirs
classpath = sourceSets["intTest"].runtimeClasspath

finalizedBy(tasks.jacocoTestReport)
shouldRunAfter(tasks.test)
}

tasks.check {
dependsOn(intTestTask)
dependsOn(intTestTask, tasks.jacocoTestReport, tasks.jacocoTestCoverageVerification)
}

pitest {
Expand All @@ -92,21 +90,26 @@ tasks.jacocoTestReport {
reports {
xml.required.set(true)
}
dependsOn(intTestTask)
dependsOn(tasks.test, intTestTask)
}

tasks.jacocoTestCoverageVerification {
executionData = files(fileTree(layout.buildDirectory).include("/jacoco/*.exec"))
violationRules {
rule {
limit {
counter = "BRANCH"
counter = "METHOD"
value = "COVEREDRATIO"
minimum = "1.0".toBigDecimal()
}
limit {
counter = "BRANCH"
value = "COVEREDRATIO"
minimum = "0.9".toBigDecimal()
}
}
}
dependsOn(intTestTask)
dependsOn(tasks.test, intTestTask)
}

tasks.jmh {
Expand Down

0 comments on commit f4402df

Please sign in to comment.