From ada51509c4fa96ff1748406d743fec50de80410c Mon Sep 17 00:00:00 2001 From: Sergey Bogolepov Date: Wed, 13 Jan 2021 15:19:18 +0700 Subject: [PATCH] Test caches for linux_x64 on Linux host. --- .../gradle/native/NativePlatformLibsIT.kt | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/NativePlatformLibsIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/NativePlatformLibsIT.kt index 441a04900cb..1df06316127 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/NativePlatformLibsIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/NativePlatformLibsIT.kt @@ -137,24 +137,31 @@ class NativePlatformLibsIT : BaseGradleIT() { @Test fun testRerunGeneratorIfCacheKindChanged() { - // Currently we can generate caches only for macos_x64 and ios_x64. - Assume.assumeTrue(HostManager.hostIsMac) + // There are no cacheable targets on MinGW for now. + Assume.assumeFalse(HostManager.hostIsMingw) deleteInstalledCompilers() - with(platformLibrariesProject("iosX64")) { - // Build Mac libraries without caches. - buildWithLightDist("tasks") { - assertSuccessful() - assertContains("Generate platform libraries for ios_x64") - } + fun buildPlatformLibrariesWithoutAndWithCaches(target: KonanTarget) { + with(platformLibrariesProject(target.presetName)) { + val targetName = target.name + // Build libraries without caches. + buildWithLightDist("tasks") { + assertSuccessful() + assertContains("Generate platform libraries for $targetName") + } - // Change cache kind and check that platform libraries generator was executed. - buildWithLightDist("tasks", "-Pkotlin.native.cacheKind.ios_x64=static") { - assertSuccessful() - assertContains("Precompile platform libraries for ios_x64 (precompilation: static)") + // Change cache kind and check that platform libraries generator was executed. + buildWithLightDist("tasks", "-Pkotlin.native.cacheKind.$targetName=static") { + assertSuccessful() + assertContains("Precompile platform libraries for $targetName (precompilation: static)") + } } } + when { + HostManager.hostIsMac -> buildPlatformLibrariesWithoutAndWithCaches(KonanTarget.IOS_X64) + HostManager.hostIsLinux -> buildPlatformLibrariesWithoutAndWithCaches(KonanTarget.LINUX_X64) + } } @Test