mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-08-18 03:21:39 +12:00
45 lines
1.6 KiB
Groovy
45 lines
1.6 KiB
Groovy
|
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||
|
|
||
|
dependencies {
|
||
|
testImplementation 'org.hamcrest:hamcrest:2.2'
|
||
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
|
||
|
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2'
|
||
|
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
|
||
|
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
|
||
|
}
|
||
|
|
||
|
tasks.withType(Test) {
|
||
|
useJUnitPlatform()
|
||
|
testLogging {
|
||
|
events TestLogEvent.FAILED,
|
||
|
TestLogEvent.PASSED,
|
||
|
TestLogEvent.SKIPPED,
|
||
|
TestLogEvent.STANDARD_OUT
|
||
|
|
||
|
exceptionFormat = 'full'
|
||
|
showExceptions = true
|
||
|
showCauses true
|
||
|
showStandardStreams = true
|
||
|
}
|
||
|
|
||
|
afterSuite { desc, result ->
|
||
|
if (!desc.parent) { // will match the outermost suite
|
||
|
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
|
||
|
def startItem = '| ', endItem = ' |'
|
||
|
def repeatLength = startItem.length() + output.length() + endItem.length()
|
||
|
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
sourceSets {
|
||
|
test {
|
||
|
// With this, the project at least compiles in eclipse (although with disabled tests)
|
||
|
// if (System.getProperty('idea.active') == null) {
|
||
|
// java {
|
||
|
// srcDirs = []
|
||
|
// }
|
||
|
// }
|
||
|
output.resourcesDir("$buildDir/classes/java/test")
|
||
|
}
|
||
|
}
|