Maven: tests support for multiplatform projects
This commit is contained in:
@@ -28,6 +28,8 @@
|
||||
|
||||
<build>
|
||||
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
||||
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
@@ -41,6 +43,17 @@
|
||||
<goal>js</goal>
|
||||
</goals>
|
||||
|
||||
<configuration>
|
||||
<multiPlatform>true</multiPlatform>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>compile-test</id>
|
||||
<phase>test-compile</phase>
|
||||
<goals>
|
||||
<goal>test-js</goal>
|
||||
</goals>
|
||||
|
||||
<configuration>
|
||||
<multiPlatform>true</multiPlatform>
|
||||
</configuration>
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package org.jetbrains
|
||||
|
||||
import org.junit.*
|
||||
import kotlin.test.*
|
||||
|
||||
class JSSpecificTest {
|
||||
@Test
|
||||
fun test1() {
|
||||
assertEquals(1, 1)
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package org.jetbrains
|
||||
|
||||
impl fun assertEquals(a: String, b: String) {
|
||||
kotlin.test.assertEquals(a, b)
|
||||
}
|
||||
@@ -24,10 +24,18 @@
|
||||
<artifactId>test-multimodule-shared</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
||||
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
@@ -44,6 +52,16 @@
|
||||
<multiPlatform>true</multiPlatform>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>compile-test</id>
|
||||
<phase>test-compile</phase>
|
||||
<goals>
|
||||
<goal>test-compile</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<multiPlatform>true</multiPlatform>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package org.jetbrains
|
||||
|
||||
import org.junit.*
|
||||
|
||||
class JVMSpecificTest {
|
||||
@Test
|
||||
fun test1() {
|
||||
Assert.assertEquals(1, 1)
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package org.jetbrains
|
||||
|
||||
import org.junit.*
|
||||
|
||||
impl fun assertEquals(a: String, b: String) {
|
||||
Assert.assertEquals(a, b)
|
||||
}
|
||||
@@ -23,11 +23,14 @@
|
||||
|
||||
<build>
|
||||
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
||||
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
|
||||
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<version>${kotlin.version}</version>
|
||||
|
||||
<executions>
|
||||
<execution>
|
||||
<id>metadata</id>
|
||||
@@ -35,6 +38,12 @@
|
||||
<goal>metadata</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-metadata</id>
|
||||
<goals>
|
||||
<goal>test-metadata</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package org.jetbrains
|
||||
|
||||
import org.junit.*
|
||||
|
||||
open class SharedTest {
|
||||
@Test
|
||||
fun test0() {
|
||||
assertEquals("Hello, World!", getGreeting())
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package org.jetbrains
|
||||
|
||||
header fun assertEquals(a: String, b: String)
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package org.junit
|
||||
|
||||
@Suppress("HEADER_WITHOUT_IMPLEMENTATION")
|
||||
header annotation class Test
|
||||
Reference in New Issue
Block a user