Better unit test output
This commit is contained in:
+15
-1
@@ -46,6 +46,20 @@ test {
|
||||
useJUnitPlatform()
|
||||
dependsOn cleanTest
|
||||
testLogging.showStandardStreams = true
|
||||
testLogging {
|
||||
events "passed", "skipped", "failed"
|
||||
info.events = debug.events
|
||||
info.exceptionFormat = debug.exceptionFormat
|
||||
|
||||
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 {
|
||||
@@ -58,4 +72,4 @@ jar {
|
||||
attributes 'Main-Class': 'rs09.Server'
|
||||
}
|
||||
from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user