Add test on multiplatform run configurations in multiproject build

The current behaviour is undesired, see next commit for fix
This commit is contained in:
Dmitry Savvinov
2020-02-17 18:07:39 +03:00
parent 1ea3db90e1
commit cc2884b8ae
5 changed files with 105 additions and 0 deletions
@@ -0,0 +1,35 @@
plugins {
id 'org.jetbrains.kotlin.multiplatform' version '1.3.61'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
mavenCentral()
}
kotlin {
jvm()
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib-common')
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
}
}
jvmMain {
dependencies {
implementation kotlin('test-junit')
}
}
}
}
@@ -0,0 +1,12 @@
pluginManagement {
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
}
}
rootProject.name = 'testsInMultiprojectBuild'
include 'subproject'
@@ -0,0 +1,11 @@
// !RENDER_TAGS: PROJECT, SETTINGS
package foo
import kotlin.test.Test
class <lineMarker descr="Run Test" project="", settings="cleanJvmTest jvmTest --tests \"foo.Foo\"">Foo</lineMarker> {
@Test
fun <lineMarker descr="Run Test" project="", settings="cleanJvmTest jvmTest --tests \"foo.Foo.test\"">test</lineMarker>() {
}
}
@@ -0,0 +1,35 @@
plugins {
id 'org.jetbrains.kotlin.multiplatform'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
mavenCentral()
}
kotlin {
jvm()
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib-common')
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
}
}
jvmMain {
dependencies {
implementation kotlin('test-junit')
}
}
}
}
@@ -0,0 +1,12 @@
// !RENDER_TAGS: PROJECT, SETTINGS
package foo
import org.junit.Test
class <lineMarker descr="Run Test" project="", settings="cleanJvmTest jvmTest --tests \"foo.SubprojectTest\"">SubprojectTest</lineMarker> {
@Test
fun <lineMarker descr="Run Test" project="", settings="cleanJvmTest jvmTest --tests \"foo.SubprojectTest.otherTest\"">otherTest</lineMarker>() {
}
}