[Gradle] Merge testCommonizer and testCleanCommonizationWithConfigurationCache
They are essentially testing the same thing. So it is logical to merge them into single test run. ^KT-61359 Verification Pending
This commit is contained in:
committed by
Space Team
parent
251f52586e
commit
d74a1133e9
+1
-33
@@ -65,7 +65,7 @@ open class CommonizerIT : KGPBaseTest() {
|
|||||||
@DisplayName("Clean commonized native distribution")
|
@DisplayName("Clean commonized native distribution")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testCleanNativeDistributionCommonization(gradleVersion: GradleVersion, @TempDir konanData: Path) {
|
fun testCleanNativeDistributionCommonization(gradleVersion: GradleVersion, @TempDir konanData: Path) {
|
||||||
nativeProject("commonizeNativeDistributionWithConfigurationCache", gradleVersion) {
|
nativeProject("commonizeNativeDistributionWithIosLinuxWindows", gradleVersion) {
|
||||||
val buildOptions = defaultBuildOptions.copy(
|
val buildOptions = defaultBuildOptions.copy(
|
||||||
konanDataDir = konanData
|
konanDataDir = konanData
|
||||||
)
|
)
|
||||||
@@ -90,38 +90,6 @@ open class CommonizerIT : KGPBaseTest() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@DisplayName("KT-61359: commonize native distribution and compile with configuration cache")
|
|
||||||
@GradleTestVersions(minVersion = TestVersions.Gradle.G_7_4)
|
|
||||||
@GradleTest
|
|
||||||
fun testCleanCommonizationWithConfigurationCache(gradleVersion: GradleVersion) {
|
|
||||||
project("commonizeNativeDistributionWithConfigurationCache", gradleVersion) {
|
|
||||||
val buildOptionsWithConfigurationCache = buildOptions.copy(configurationCache = true)
|
|
||||||
// Clean native distribution -> capture configuration cache state
|
|
||||||
build(":cleanNativeDistributionCommonization")
|
|
||||||
build(":compileNativeMainKotlinMetadata", buildOptions = buildOptionsWithConfigurationCache) {
|
|
||||||
assertTasksExecuted(":commonizeNativeDistribution")
|
|
||||||
assertTasksExecuted(":compileNativeMainKotlinMetadata")
|
|
||||||
assertConfigurationCacheStored()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Clean task outputs -> reuse configuration cache
|
|
||||||
build(":clean")
|
|
||||||
build(":compileNativeMainKotlinMetadata", buildOptions = buildOptionsWithConfigurationCache) {
|
|
||||||
assertTasksUpToDate(":commonizeNativeDistribution")
|
|
||||||
assertTasksExecuted(":compileNativeMainKotlinMetadata")
|
|
||||||
assertConfigurationCacheReused()
|
|
||||||
}
|
|
||||||
|
|
||||||
// full clean -> reuse configuration cache
|
|
||||||
build("clean", ":cleanNativeDistributionCommonization")
|
|
||||||
build(":compileNativeMainKotlinMetadata", buildOptions = buildOptionsWithConfigurationCache) {
|
|
||||||
assertTasksExecuted(":commonizeNativeDistribution")
|
|
||||||
assertTasksExecuted(":compileNativeMainKotlinMetadata")
|
|
||||||
assertConfigurationCacheReused()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@DisplayName("Commonize Curl Interop UP-TO-DATE check")
|
@DisplayName("Commonize Curl Interop UP-TO-DATE check")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testCommonizeCurlInteropUTDCheck(gradleVersion: GradleVersion) {
|
fun testCommonizeCurlInteropUTDCheck(gradleVersion: GradleVersion) {
|
||||||
|
|||||||
+24
-12
@@ -88,22 +88,34 @@ class ConfigurationCacheIT : AbstractConfigurationCacheIT() {
|
|||||||
@GradleTest
|
@GradleTest
|
||||||
fun testCommonizer(gradleVersion: GradleVersion, @TempDir konanHome: Path) {
|
fun testCommonizer(gradleVersion: GradleVersion, @TempDir konanHome: Path) {
|
||||||
project("native-configuration-cache", gradleVersion) {
|
project("native-configuration-cache", gradleVersion) {
|
||||||
build(
|
val buildOptions = defaultBuildOptions.copy(konanDataDir = konanHome)
|
||||||
":commonizeNativeDistribution",
|
build(":lib:compileCommonMainKotlinMetadata", buildOptions = buildOptions) {
|
||||||
) {
|
assertTasksExecuted(":commonizeNativeDistribution")
|
||||||
assertOutputContains("0 problems were found storing the configuration cache.")
|
assertTasksExecuted(":lib:compileCommonMainKotlinMetadata")
|
||||||
|
assertConfigurationCacheStored()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Override kotlin native home location to be able to run clean native distribution commonization task
|
build("clean", ":cleanNativeDistributionCommonization", buildOptions = buildOptions) {
|
||||||
// since by default it is global location on host
|
assertTasksExecuted(":cleanNativeDistributionCommonization")
|
||||||
val buildOptions = defaultBuildOptions.copy(
|
assertConfigurationCacheStored()
|
||||||
freeArgs = listOf("-Porg.jetbrains.kotlin.native.home=$konanHome"),
|
|
||||||
konanDataDir = null
|
|
||||||
)
|
|
||||||
build(":cleanNativeDistributionCommonization", buildOptions = buildOptions) {
|
|
||||||
assertOutputContains("0 problems were found storing the configuration cache.")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
build(":lib:compileCommonMainKotlinMetadata", buildOptions = buildOptions) {
|
||||||
|
assertTasksExecuted(":commonizeNativeDistribution")
|
||||||
|
assertTasksExecuted(":lib:compileCommonMainKotlinMetadata")
|
||||||
|
assertConfigurationCacheReused()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@NativeGradlePluginTests
|
||||||
|
@GradleTestVersions(
|
||||||
|
minVersion = TestVersions.Gradle.G_7_4,
|
||||||
|
additionalVersions = [TestVersions.Gradle.G_7_6],
|
||||||
|
)
|
||||||
|
@GradleTest
|
||||||
|
fun testCInteropCommonizer(gradleVersion: GradleVersion) {
|
||||||
|
project("native-configuration-cache", gradleVersion) {
|
||||||
testConfigurationCacheOf(":lib:commonizeCInterop")
|
testConfigurationCacheOf(":lib:commonizeCInterop")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-13
@@ -1,13 +0,0 @@
|
|||||||
plugins {
|
|
||||||
kotlin("multiplatform")
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
kotlin {
|
|
||||||
linuxX64()
|
|
||||||
linuxArm64()
|
|
||||||
}
|
|
||||||
-5
@@ -1,5 +0,0 @@
|
|||||||
package lib
|
|
||||||
|
|
||||||
fun main() {
|
|
||||||
platform.zlib.ZLIB_VERNUM
|
|
||||||
}
|
|
||||||
+4
-1
@@ -1,3 +1,6 @@
|
|||||||
fun foo() = "bar" //+ my.cinterop.foo()
|
fun foo() = "bar" //+ my.cinterop.foo()
|
||||||
|
|
||||||
fun main() = println(foo())
|
fun main() {
|
||||||
|
platform.zlib.ZLIB_VERNUM
|
||||||
|
println(foo())
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user