-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
44 lines (35 loc) · 1.06 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
plugins {
id "groovy"
}
group = "org.vanroon"
version = "1.0.0"
repositories {
mavenCentral()
}
dependencies {
compile "org.codehaus.groovy:groovy-all:2.5.0"
testCompile "com.lesfurets:jenkins-pipeline-unit:1.1"
testCompile "junit:junit:4.12"
}
test {
// delete old test reports
dependsOn cleanTest
// don't stop if tests fail
ignoreFailures = true
// minimize logging
testLogging.maxGranularity = 0
// show stdout from tests
onOutput { dest, event -> print event.message }
// show test results
def results = []
afterTest { desc, result -> println "${desc.className.split("\\.")[-1]}: " +
"${desc.name}: ${result.resultType}" }
afterSuite { desc, result -> if (desc.className) { results << result } }
// show summary
doLast {
println "Tests: ${results.sum { it.testCount }}" +
", Failures: ${results.sum { it.failedTestCount }}" +
", Errors: ${results.sum { it.exceptions.size() }}" +
", Skipped: ${results.sum { it.skippedTestCount }}"
}
}