[K/N][gradle] Fixed some gradle integration tests

This commit is contained in:
Igor Chevdar
2022-11-30 15:27:25 +02:00
committed by Space Team
parent 84d9afafd2
commit ebaa09a710
2 changed files with 11 additions and 35 deletions
@@ -192,35 +192,6 @@ class NativeDownloadAndPlatformLibsIT : BaseGradleIT() {
} }
} }
@Test
fun testRerunGeneratorIfCacheKindChanged() {
// There are no cacheable targets on MinGW for now.
Assume.assumeFalse(HostManager.hostIsMingw)
fun buildPlatformLibrariesWithoutAndWithCaches(target: KonanTarget) {
val presetName = target.presetName
val targetName = target.name
with(platformLibrariesProject(presetName)) {
// 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.$presetName=static") {
assertSuccessful()
assertContains("Precompile platform libraries for $targetName (precompilation: static)")
}
}
}
when {
HostManager.host == KonanTarget.MACOS_ARM64 -> buildPlatformLibrariesWithoutAndWithCaches(KonanTarget.IOS_ARM64)
HostManager.host == KonanTarget.MACOS_X64 -> buildPlatformLibrariesWithoutAndWithCaches(KonanTarget.IOS_X64)
HostManager.hostIsLinux -> buildPlatformLibrariesWithoutAndWithCaches(KonanTarget.LINUX_X64)
}
}
@Test @Test
fun testCanUsePrebuiltDistribution() = with(platformLibrariesProject("linuxX64")) { fun testCanUsePrebuiltDistribution() = with(platformLibrariesProject("linuxX64")) {
build("assemble", "-Pkotlin.native.distribution.type=prebuilt") { build("assemble", "-Pkotlin.native.distribution.type=prebuilt") {
@@ -132,9 +132,11 @@ class NativeIrLinkerIssuesIT : BaseGradleIT() {
|Project dependencies: |Project dependencies:
|+--- org.sample:liba (org.sample:liba-native): 2.0 |+--- org.sample:liba (org.sample:liba-native): 2.0
|| \--- stdlib: $kotlinNativeCompilerVersion || \--- stdlib: $kotlinNativeCompilerVersion
|\--- org.sample:libb (org.sample:libb-native): 1.0 |+--- org.sample:libb (org.sample:libb-native): 1.0
| ^^^ This module requires symbol sample.liba/C|null[0]. || ^^^ This module requires symbol sample.liba/C|null[0].
| +--- org.sample:liba (org.sample:liba-native): 1.0 -> 2.0 (*) || +--- org.sample:liba (org.sample:liba-native): 1.0 -> 2.0 (*)
|| \--- stdlib: $kotlinNativeCompilerVersion
|\--- org.jetbrains.kotlin.native.platform.* (NNN libraries): $kotlinNativeCompilerVersion
| \--- stdlib: $kotlinNativeCompilerVersion | \--- stdlib: $kotlinNativeCompilerVersion
| |
|(*) - dependencies omitted (listed previously) |(*) - dependencies omitted (listed previously)
@@ -192,9 +194,11 @@ class NativeIrLinkerIssuesIT : BaseGradleIT() {
|+--- org.sample:liba (org.sample:liba-native): 2.0 |+--- org.sample:liba (org.sample:liba-native): 2.0
|| ^^^ This module contains symbol sample.liba/B|null[0] that is the cause of the conflict. || ^^^ This module contains symbol sample.liba/B|null[0] that is the cause of the conflict.
|| \--- stdlib: $kotlinNativeCompilerVersion || \--- stdlib: $kotlinNativeCompilerVersion
|\--- org.sample:libb (org.sample:libb-native): 1.0 |+--- org.sample:libb (org.sample:libb-native): 1.0
| +--- org.sample:liba (org.sample:liba-native): 1.0 -> 2.0 (*) || +--- org.sample:liba (org.sample:liba-native): 1.0 -> 2.0 (*)
| | ^^^ This module contains symbol sample.liba/B|null[0] that is the cause of the conflict. || | ^^^ This module contains symbol sample.liba/B|null[0] that is the cause of the conflict.
|| \--- stdlib: $kotlinNativeCompilerVersion
|\--- org.jetbrains.kotlin.native.platform.* (NNN libraries): $kotlinNativeCompilerVersion
| \--- stdlib: $kotlinNativeCompilerVersion | \--- stdlib: $kotlinNativeCompilerVersion
| |
|(*) - dependencies omitted (listed previously) |(*) - dependencies omitted (listed previously)
@@ -271,6 +275,7 @@ class NativeIrLinkerIssuesIT : BaseGradleIT() {
val errorMessage = ERROR_LINE_REGEX.findAll(getOutputForTask("linkDebugExecutableNative")) val errorMessage = ERROR_LINE_REGEX.findAll(getOutputForTask("linkDebugExecutableNative"))
.map { matchResult -> matchResult.groupValues[1] } .map { matchResult -> matchResult.groupValues[1] }
.filterNot { it.startsWith("w:") || it.startsWith("v:") || it.startsWith("i:") }
.map { line -> line.replace(kotlinNativeTargetName, MASKED_TARGET_NAME) } .map { line -> line.replace(kotlinNativeTargetName, MASKED_TARGET_NAME) }
.map { line -> .map { line ->
line.replace(COMPRESSED_PLATFORM_LIBS_REGEX) { result -> line.replace(COMPRESSED_PLATFORM_LIBS_REGEX) { result ->