ext.testsFailed = false
/* testTask0 is the main test task */
task testTask0(type: Test) {
+ group = "Verification"
+ description = "The main test task. Runs all non-testTaskN-labelled tests (unless excluded)"
useTestNG() {
includeGroups testng_groups.split(",")
excludeGroups testng_excluded_groups.split(",")
/* separated tests */
task testTask1(type: Test) {
+ group = "Verification"
+ description = "Tests that need to be isolated from the main test run"
useTestNG() {
includeGroups name
excludeGroups testng_excluded_groups.split(",")
if (useClover) {
dependsOn cloverClasses
} else { //?
- dependsOn compileJava //?
+ dependsOn testClasses //?
}
// run main tests first
/* END of test tasks results summary */
task verifyTestStatus {
+ group = "Verification"
+ description = "Task that FAILs the build if any tests failed"
doLast {
if (testsFailed) {
throw new GradleException("There were failing tests!")
test {
// from original test task
if (useClover) {
- //dependsOn.clear()
dependsOn cloverClasses
} else { //?
- dependsOn compileJava //?
+ dependsOn testClasses
}
dependsOn tasks.withType(Test).matching {t -> t.getName().startsWith("testTask")}
finalizedBy verifyTestStatus