Skip to content

Commit c921ac7

Browse files
committed
fix test task, missing dependency to sourceSet.test, starting with Gradle 9
1 parent 852b330 commit c921ac7

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

build.gradle

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import groovy.transform.Memoized
2+
import org.gradle.api.tasks.testing.TestResult
3+
import org.gradle.api.tasks.testing.TestDescriptor
24

35
plugins {
46
//Support for IntelliJ IDEA
@@ -125,7 +127,7 @@ subprojects {
125127
options.addBooleanOption('html5', true)
126128
}
127129

128-
tasks.withType(Test) {//Configure all tests
130+
tasks.withType(Test).configureEach {//Configure all tests
129131

130132
def examplesDir = rootProject.layout.projectDirectory.dir("key.ui/examples").getAsFile()
131133
def runAllProofsReportDir = layout.buildDirectory.dir("report/runallproves/").get().getAsFile()
@@ -141,12 +143,19 @@ subprojects {
141143

142144
forkEvery = 0 //default
143145
maxParallelForks = 1 // weigl: test on master
144-
}
145146

146-
tasks.withType(Test) {
147147
useJUnitPlatform {
148148
includeEngines 'junit-jupiter'
149149
}
150+
151+
// these seems to be missing starting with Gradle 9
152+
testClassesDirs = sourceSets.test.output.classesDirs
153+
classpath = sourceSets.test.runtimeClasspath
154+
155+
// Fail on empty test suites
156+
afterSuite { suite, result ->
157+
assert result.testCount > 0, "There are no executed test. This is unexpected and should be investigated!"
158+
}
150159
}
151160

152161

0 commit comments

Comments
 (0)