From d68cb7b68bd021457fc1f38105d68a1949ae0ba5 Mon Sep 17 00:00:00 2001 From: Alexey Tsvetkov <654232+AlexeyTsvetkov@users.noreply.github.com> Date: Fri, 26 Feb 2021 21:11:40 +0300 Subject: [PATCH] Test runDistributable with MPP project (#436) --- .../jetbrains/compose/DesktopApplicationTest.kt | 14 ++++++++++++++ .../application/mpp/src/jvmMain/kotlin/main.kt | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/DesktopApplicationTest.kt b/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/DesktopApplicationTest.kt index efbaefbd77..bb26900960 100644 --- a/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/DesktopApplicationTest.kt +++ b/gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/DesktopApplicationTest.kt @@ -35,6 +35,20 @@ class DesktopApplicationTest : GradlePluginTestBase() { } } + @Test + fun testRunMpp() = with(testProject(TestProjects.mpp)) { + val logLine = "Kotlin MPP app is running!" + gradle("run").build().checks { check -> + check.taskOutcome(":run", TaskOutcome.SUCCESS) + check.logContains(logLine) + } + gradle("runDistributable").build().checks { check -> + check.taskOutcome(":createDistributable", TaskOutcome.SUCCESS) + check.taskOutcome(":runDistributable", TaskOutcome.SUCCESS) + check.logContains(logLine) + } + } + @Test fun kotlinDsl(): Unit = with(testProject(TestProjects.jvmKotlinDsl)) { gradle(":package", "--dry-run").build() diff --git a/gradle-plugins/compose/src/test/test-projects/application/mpp/src/jvmMain/kotlin/main.kt b/gradle-plugins/compose/src/test/test-projects/application/mpp/src/jvmMain/kotlin/main.kt index 78e3db2779..4d7210e2be 100644 --- a/gradle-plugins/compose/src/test/test-projects/application/mpp/src/jvmMain/kotlin/main.kt +++ b/gradle-plugins/compose/src/test/test-projects/application/mpp/src/jvmMain/kotlin/main.kt @@ -1 +1,3 @@ -fun main() {} \ No newline at end of file +fun main() { + println("Kotlin MPP app is running!") +} \ No newline at end of file