-
Notifications
You must be signed in to change notification settings - Fork 47
/
ReportsCachingTests.kt
56 lines (52 loc) · 2.12 KB
/
ReportsCachingTests.kt
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
50
51
52
53
54
55
56
package kotlinx.kover.test.functional.cases
import kotlinx.kover.api.*
import kotlinx.kover.test.functional.cases.utils.*
import kotlinx.kover.test.functional.core.BaseGradleScriptTest
import org.gradle.testkit.runner.*
import kotlin.test.*
internal class ReportsCachingTests : BaseGradleScriptTest() {
@Test
fun testCaching() {
builder("Test caching aggregate reports")
.engines(CoverageEngine.INTELLIJ, CoverageEngine.JACOCO)
.sources("simple")
.build()
.run("build", "--build-cache") {
checkDefaultBinaryReport()
checkDefaultReports()
}
.run("clean", "--build-cache") {
checkDefaultBinaryReport(false)
checkDefaultReports(false)
}
.run("build", "--build-cache") {
checkDefaultBinaryReport()
checkDefaultReports()
outcome(":test") { assertEquals(TaskOutcome.FROM_CACHE, this) }
outcome(":koverXmlReport") { assertEquals(TaskOutcome.FROM_CACHE, this) }
outcome(":koverHtmlReport") { assertEquals(TaskOutcome.FROM_CACHE, this) }
}
}
@Test
fun testModuleCaching() {
builder("Test caching module reports")
.engines(CoverageEngine.INTELLIJ, CoverageEngine.JACOCO)
.sources("simple")
.build()
.run("koverModuleReport", "--build-cache") {
checkDefaultBinaryReport()
checkDefaultModuleReports()
}
.run("clean", "--build-cache") {
checkDefaultBinaryReport(false)
checkDefaultModuleReports(false)
}
.run("koverModuleReport", "--build-cache") {
checkDefaultBinaryReport()
checkDefaultModuleReports()
outcome(":test") { assertEquals(TaskOutcome.FROM_CACHE, this) }
outcome(":koverXmlModuleReport") { assertEquals(TaskOutcome.FROM_CACHE, this) }
outcome(":koverHtmlModuleReport") { assertEquals(TaskOutcome.FROM_CACHE, this) }
}
}
}