JAL-4167 Adjustments to get clover to work with normal tests. Adjustment made on...
authorBen Soares <b.soares@dundee.ac.uk>
Wed, 26 Apr 2023 11:11:49 +0000 (12:11 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Wed, 26 Apr 2023 11:11:49 +0000 (12:11 +0100)
build.gradle

index 2d2dad0..159da8d 100644 (file)
@@ -1738,6 +1738,8 @@ compileTestJava.dependsOn compileJava
 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(",")
@@ -1749,6 +1751,8 @@ task testTask0(type: Test) {
 
 /* 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(",")
@@ -1775,7 +1779,7 @@ tasks.withType(Test).matching {t -> t.getName().startsWith("testTask")}.all { te
   if (useClover) {
     dependsOn cloverClasses
   } else { //?
-    dependsOn compileJava //?
+    dependsOn testClasses //?
   }
 
   // run main tests first
@@ -1873,6 +1877,8 @@ private static void printResults(allResults) {
 /* 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!")
@@ -1883,10 +1889,9 @@ task verifyTestStatus {
 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