-
Notifications
You must be signed in to change notification settings - Fork 9
/
test.gradle
49 lines (43 loc) · 1.33 KB
/
test.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
sourceSets {
functionalTest {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
integrationTest {
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}
configurations {
functionalTestImplementation.extendsFrom(implementation, testImplementation)
integrationTestImplementation.extendsFrom(implementation, testImplementation)
}
test {
useJUnitPlatform()
testLogging.events "passed", "skipped", "failed"
}
def integrationTest = tasks.register('integrationTest', Test) {
it.useJUnitPlatform()
it.testLogging.events "passed", "skipped", "failed"
it.testClassesDirs = sourceSets.integrationTest.output.classesDirs
it.classpath = sourceSets.integrationTest.runtimeClasspath
it.shouldRunAfter("test")
}
tasks.register('functionalTest', Test) {
it.useJUnitPlatform()
it.environment 'jupiter.functionalTest', 'true'
it.testLogging.events "passed", "skipped", "failed"
it.testClassesDirs = sourceSets.functionalTest.output.classesDirs
it.classpath = sourceSets.functionalTest.runtimeClasspath
it.shouldRunAfter(integrationTest, "test")
}
task runTests {
description 'Run all test categories in order.'
group 'verification'
tasks.withType(Test.class).each {
dependsOn(it)
}
}
tasks.named('check') {
it.dependsOn(tasks.functionalTest, tasks.integrationTest)
}