From f0aa4a59e3c84aa6cac61d5bb648d9258b22062c Mon Sep 17 00:00:00 2001 From: "Alexander.Likhachev" Date: Tue, 13 Oct 2020 22:40:27 +0300 Subject: [PATCH] [Gradle, K/N] Tests cleanup --- .../kotlin/gradle/native/GeneralNativeIT.kt | 8 ++------ .../kotlin/exported.kt | 0 .../native-binaries/groovy-dsl/build.gradle | 18 ----------------- .../kotlin-dsl/build.gradle.kts | 20 ------------------- .../native-endorsed/build.gradle.kts | 8 -------- .../src/hostMain/kotlin/main.kt | 12 +++++++++++ 6 files changed, 14 insertions(+), 52 deletions(-) rename libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-binaries/frameworks/exported/src/{iosMain => commonMain}/kotlin/exported.kt (100%) create mode 100644 libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-endorsed/src/hostMain/kotlin/main.kt diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/GeneralNativeIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/GeneralNativeIT.kt index d58d4766eb1..181b6ebc25c 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/GeneralNativeIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/native/GeneralNativeIT.kt @@ -618,13 +618,9 @@ class GeneralNativeIT : BaseGradleIT() { // Check that test binaries can be accessed in a buildscript. build("checkNewGetters") { assertSuccessful() - val suffixes = listOf("kexe") + val suffix = if (HostManager.hostIsMingw) "exe" else "kexe" val names = listOf("test", "another") - val files = names.flatMap { name -> - suffixes.map { suffix -> - "$name.$suffix" - } - } + val files = names.map { "$it.$suffix" } files.forEach { assertContains("Get test: $it") diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-binaries/frameworks/exported/src/iosMain/kotlin/exported.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-binaries/frameworks/exported/src/commonMain/kotlin/exported.kt similarity index 100% rename from libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-binaries/frameworks/exported/src/iosMain/kotlin/exported.kt rename to libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-binaries/frameworks/exported/src/commonMain/kotlin/exported.kt diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-binaries/groovy-dsl/build.gradle b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-binaries/groovy-dsl/build.gradle index 3b514dfdf80..c220fbf14f8 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-binaries/groovy-dsl/build.gradle +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-binaries/groovy-dsl/build.gradle @@ -74,23 +74,5 @@ kotlin { // Using a typed getter: println("Check run task: ${binaries.getExecutable("foo", RELEASE).runTask.name}") } - iosArm64("ios") { - binaries { - framework { - export project(':exported') - } - framework('custom', [RELEASE]) { - embedBitcode = 'DISABLE' - linkerOpts = ['-L.'] - freeCompilerArgs = ["-Xtime"] - isStatic = true - } - } - } - iosX64("iosSim") { - binaries { - framework() - } - } } } diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-binaries/kotlin-dsl/build.gradle.kts b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-binaries/kotlin-dsl/build.gradle.kts index 05045712a82..6cbf3d48a02 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-binaries/kotlin-dsl/build.gradle.kts +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-binaries/kotlin-dsl/build.gradle.kts @@ -63,24 +63,4 @@ kotlin { // Using a typed getter: println("Check run task: ${binaries.getExecutable("foo", RELEASE).runTask?.name}") } - - iosArm64("ios") { - binaries { - framework { - export(project(":exported")) - } - framework("custom", listOf(RELEASE)) { - embedBitcode("disable") - linkerOpts = mutableListOf("-L.") - freeCompilerArgs = mutableListOf("-Xtime") - isStatic = true - } - } - } - - iosX64("iosSim") { - binaries { - framework() - } - } } diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-endorsed/build.gradle.kts b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-endorsed/build.gradle.kts index f8ca427daa0..ae86f8b9259 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-endorsed/build.gradle.kts +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-endorsed/build.gradle.kts @@ -8,18 +8,10 @@ repositories { } kotlin { - val commonNative by sourceSets.creating {} - ("host") { - compilations["main"].defaultSourceSet { - dependsOn(commonNative) - } compilations.all { kotlinOptions.verbose = true enableEndorsedLibs = true } - binaries { - executable(listOf(DEBUG)) - } } } diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-endorsed/src/hostMain/kotlin/main.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-endorsed/src/hostMain/kotlin/main.kt new file mode 100644 index 00000000000..d332977d64a --- /dev/null +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/native-endorsed/src/hostMain/kotlin/main.kt @@ -0,0 +1,12 @@ +import kotlinx.cli.* + +fun main(args: Array) { + val argParser = ArgParser("test") + val mode by argParser.option( + ArgType.Choice(listOf("video", "audio", "both")), shortName = "m", description = "Play mode") + .default("both") + val size by argParser.option(ArgType.Int, shortName = "s", description = "Required size of videoplayer window") + .delimiter(",") + val fileName by argParser.argument(ArgType.String, description = "File to play") + argParser.parse(args) +}