datastructures/gradle/test/junit5.gradle

29 lines
1.1 KiB
Groovy
Raw Normal View History

2020-09-12 22:42:03 +02:00
2021-04-08 22:36:40 +02:00
def junitVersion = project.hasProperty('junit.version')?project.property('junit.version'):'5.7.0'
2020-09-12 22:42:03 +02:00
def hamcrestVersion = project.hasProperty('hamcrest.version')?project.property('hamcrest.version'):'2.2'
dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}"
testImplementation "org.hamcrest:hamcrest-library:${hamcrestVersion}"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
}
test {
useJUnitPlatform()
2021-04-08 22:36:40 +02:00
failFast = false
2020-09-12 22:42:03 +02:00
testLogging {
events 'STARTED', 'PASSED', 'FAILED', 'SKIPPED'
}
2021-04-08 22:36:40 +02:00
jvmArgs '--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED'
2020-09-12 22:42:03 +02:00
afterSuite { desc, result ->
if (!desc.parent) {
println "\nTest result: ${result.resultType}"
println "Test summary: ${result.testCount} tests, " +
"${result.successfulTestCount} succeeded, " +
"${result.failedTestCount} failed, " +
"${result.skippedTestCount} skipped"
}
}
}