diff options
Diffstat (limited to 'gradle/junit.gradle')
-rw-r--r-- | gradle/junit.gradle | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/gradle/junit.gradle b/gradle/junit.gradle index f603a4e4..da0cea8c 100644 --- a/gradle/junit.gradle +++ b/gradle/junit.gradle | |||
@@ -1,27 +1,28 @@ | |||
1 | apply plugin: 'jacoco' | 1 | apply plugin: 'jacoco' |
2 | 2 | ||
3 | dependencies { | 3 | dependencies { |
4 | testCompile "org.junit.jupiter:junit-jupiter-api:${junitVersion}" | 4 | testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}" |
5 | testRuntime "org.junit.jupiter:junit-jupiter-engine:${junitVersion}" | 5 | testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitVersion}" |
6 | testCompile "org.junit.jupiter:junit-jupiter-params:${junitVersion}" | 6 | testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}" |
7 | testCompile "org.hamcrest:hamcrest:${hamcrestVersion}" | 7 | testImplementation "org.hamcrest:hamcrest:${hamcrestVersion}" |
8 | } | 8 | } |
9 | 9 | ||
10 | test { | 10 | def jacocoTestReport = tasks.named('jacocoTestReport') |
11 | jacocoTestReport.configure { | ||
12 | dependsOn test | ||
13 | reports { | ||
14 | xml.required = true | ||
15 | } | ||
16 | } | ||
17 | |||
18 | tasks.named('test') { | ||
11 | useJUnitPlatform { | 19 | useJUnitPlatform { |
12 | excludeTags 'slow' | 20 | excludeTags 'slow' |
13 | } | 21 | } |
22 | finalizedBy jacocoTestReport | ||
14 | } | 23 | } |
15 | 24 | ||
16 | task slowTest(type: Test) { | 25 | tasks.register('slowTest', Test) { |
17 | useJUnitPlatform() | 26 | useJUnitPlatform() |
27 | finalizedBy jacocoTestReport | ||
18 | } | 28 | } |
19 | |||
20 | jacocoTestReport { | ||
21 | dependsOn test | ||
22 | reports { | ||
23 | xml.enabled true | ||
24 | } | ||
25 | } | ||
26 | |||
27 | test.finalizedBy(jacocoTestReport) \ No newline at end of file | ||