From 08f6e21f5df8a365a5130c7569c4405fffaffcf4 Mon Sep 17 00:00:00 2001 From: Andrey Yastrebov Date: Mon, 4 Mar 2024 10:56:52 +0100 Subject: [PATCH] KT-66225 Add NativeBinary baseName test --- .../gradle/unitTests/NativeBinaryTest.kt | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 libraries/tools/kotlin-gradle-plugin/src/functionalTest/kotlin/org/jetbrains/kotlin/gradle/unitTests/NativeBinaryTest.kt diff --git a/libraries/tools/kotlin-gradle-plugin/src/functionalTest/kotlin/org/jetbrains/kotlin/gradle/unitTests/NativeBinaryTest.kt b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/kotlin/org/jetbrains/kotlin/gradle/unitTests/NativeBinaryTest.kt new file mode 100644 index 00000000000..d67fd25abe4 --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin/src/functionalTest/kotlin/org/jetbrains/kotlin/gradle/unitTests/NativeBinaryTest.kt @@ -0,0 +1,43 @@ +/* + * Copyright 2010-2024 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:Suppress("FunctionName") + +package org.jetbrains.kotlin.gradle.unitTests + +import org.jetbrains.kotlin.gradle.dsl.multiplatformExtension +import org.jetbrains.kotlin.gradle.util.buildProjectWithMPP +import kotlin.test.* + +class NativeBinaryTest { + + @Test + fun `test baseNameProvider`() { + val initialBaseName = "Shared" + + buildProjectWithMPP { + multiplatformExtension.apply { + iosSimulatorArm64 { + binaries { + framework(initialBaseName) { + val nameProvider = this.baseNameProvider + + fun checkBaseName(name: String) { + assertEquals(baseName, name) + assertEquals(nameProvider.get(), name) + } + + checkBaseName(initialBaseName) + + val newBaseName = "NewShared" + this.baseName = newBaseName + checkBaseName(newBaseName) + } + } + } + } + } + } +} \ No newline at end of file