Explorar o código

Ensure tests exist

Rob Winch %!s(int64=5) %!d(string=hai) anos
pai
achega
282ba7a2f3
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  1. 9 0
      build.gradle

+ 9 - 0
build.gradle

@@ -15,4 +15,13 @@ allprojects {
 	dependencies {
 		checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:0.0.23-SNAPSHOT"
 	}
+
+	// Ensure every test task has at least a single test
+	tasks.withType(Test).configureEach {
+		afterSuite { desc, result ->
+			if (result.testCount == 0) {
+				throw new IllegalStateException("No tests were found. Ensure that useJUnitPlatform was used.")
+			}
+		}
+	}
 }