File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -212,8 +212,13 @@ task buildAndRunTests(type: TestLanguages, dependsOn: buildLanguages) {
212
212
report(format : ' frames' , todir : " $buildDir /junitreport" )
213
213
}
214
214
ant. echo(" JUnit report placed into $buildDir /junitreport/index.html" )
215
+ }
216
+ }
215
217
216
- // evaluate junit result and fail on error
218
+ task failOnTestError () {
219
+ description ' evaluate junit result and fail on error'
220
+ doLast {
221
+
217
222
def junitResult = new XmlSlurper (). parse(file(' TESTS-TestSuites.xml' ))
218
223
def failures = junitResult. ' **' . findAll { it. name() == ' failure' }
219
224
def errors = junitResult. ' **' . findAll { it. name() == ' errors' }
@@ -223,8 +228,9 @@ task buildAndRunTests(type: TestLanguages, dependsOn: buildLanguages) {
223
228
throw new GradleException (amount + " JUnit tests failed. Check the test report for details." )
224
229
}
225
230
}
226
- }
227
231
232
+ }
233
+ buildAndRunTests. configure { finalizedBy failOnTestError }
228
234
check. dependsOn buildAndRunTests
229
235
230
236
task packageLanguages (type : Zip , dependsOn : buildLanguages) {
You can’t perform that action at this time.
0 commit comments