-
Notifications
You must be signed in to change notification settings - Fork 55
/
JvmProjectTests.kt
54 lines (49 loc) · 1.94 KB
/
JvmProjectTests.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
/*
* Copyright 2016-2024 JetBrains s.r.o.
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
*/
package kotlinx.validation.test
import kotlinx.validation.api.*
import kotlinx.validation.api.resolve
import kotlinx.validation.api.test
import org.assertj.core.api.Assertions
import org.junit.Test
class JvmProjectTests : BaseKotlinGradleTest() {
@Test
fun `apiDump for a project with generated sources only`() {
val runner = test {
buildGradleKts {
resolve("/examples/gradle/base/withPlugin.gradle.kts")
resolve("/examples/gradle/configuration/generatedSources/generatedJvmSources.gradle.kts")
}
// TODO: enable configuration cache back when we start skipping tasks correctly
runner(withConfigurationCache = false) {
arguments.add(":apiDump")
}
}
runner.build().apply {
assertTaskSuccess(":apiDump")
val expectedApi = readFileList("/examples/classes/GeneratedSources.dump")
Assertions.assertThat(rootProjectApiDump.readText()).isEqualToIgnoringNewLines(expectedApi)
}
}
@Test
fun `apiCheck for a project with generated sources only`() {
val runner = test {
buildGradleKts {
resolve("/examples/gradle/base/withPlugin.gradle.kts")
resolve("/examples/gradle/configuration/generatedSources/generatedJvmSources.gradle.kts")
}
apiFile(projectName = rootProjectDir.name) {
resolve("/examples/classes/GeneratedSources.dump")
}
// TODO: enable configuration cache back when we start skipping tasks correctly
runner(withConfigurationCache = false) {
arguments.add(":apiCheck")
}
}
runner.build().apply {
assertTaskSuccess(":apiCheck")
}
}
}