JPS, -Xcommon-sources: write tests
This commit is contained in:
+18
@@ -578,6 +578,24 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
|||||||
public void testAllFilesPresentInCustom() throws Exception {
|
public void testAllFilesPresentInCustom() throws Exception {
|
||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("commonSourcesCompilerArg")
|
||||||
|
public void testCommonSourcesCompilerArg() throws Exception {
|
||||||
|
runTest("jps-plugin/testData/incremental/multiModule/multiplatform/custom/commonSourcesCompilerArg/");
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("jps-plugin/testData/incremental/multiModule/multiplatform/custom/commonSourcesCompilerArg")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class CommonSourcesCompilerArg extends AbstractIncrementalJpsTest {
|
||||||
|
private void runTest(String testDataFilePath) throws Exception {
|
||||||
|
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testAllFilesPresentInCommonSourcesCompilerArg() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/commonSourcesCompilerArg"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("jps-plugin/testData/incremental/pureKotlin")
|
@TestMetadata("jps-plugin/testData/incremental/pureKotlin")
|
||||||
|
|||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
c [sourceSetHolder]
|
||||||
|
|
||||||
|
pJvm [compilationAndSourceSetHolder, jvm]
|
||||||
|
pJvm -> c [include]
|
||||||
|
|
||||||
|
pJs [compilationAndSourceSetHolder, js]
|
||||||
|
pJs -> c [include]
|
||||||
jps-plugin/testData/incremental/multiModule/multiplatform/custom/commonSourcesCompilerArg/_steps.txt
Vendored
+5
@@ -0,0 +1,5 @@
|
|||||||
|
use @Optional in JS
|
||||||
|
remove @Optional from JS
|
||||||
|
use @Optional in JVM
|
||||||
|
remove @Optional from JVM
|
||||||
|
add another @Optional in Common module
|
||||||
Vendored
+62
@@ -0,0 +1,62 @@
|
|||||||
|
================ Step #1 use @Optional in JS =================
|
||||||
|
|
||||||
|
Building c
|
||||||
|
Building pJs
|
||||||
|
Compiling files:
|
||||||
|
pJs/src/c.kt
|
||||||
|
End of files
|
||||||
|
Exit code: ABORT
|
||||||
|
------------------------------------------
|
||||||
|
COMPILATION FAILED
|
||||||
|
Declaration annotated with '@OptionalExpectation' can only be used in common module sources
|
||||||
|
|
||||||
|
================ Step #2 remove @Optional from JS =================
|
||||||
|
|
||||||
|
Building c
|
||||||
|
Building pJs
|
||||||
|
Exit code: NOTHING_DONE
|
||||||
|
------------------------------------------
|
||||||
|
Building pJvm
|
||||||
|
Exit code: NOTHING_DONE
|
||||||
|
------------------------------------------
|
||||||
|
|
||||||
|
================ Step #3 use @Optional in JVM =================
|
||||||
|
|
||||||
|
Building c
|
||||||
|
Building pJs
|
||||||
|
Exit code: NOTHING_DONE
|
||||||
|
------------------------------------------
|
||||||
|
Building pJvm
|
||||||
|
Compiling files:
|
||||||
|
pJvm/src/c.kt
|
||||||
|
End of files
|
||||||
|
Exit code: ABORT
|
||||||
|
------------------------------------------
|
||||||
|
COMPILATION FAILED
|
||||||
|
Declaration annotated with '@OptionalExpectation' can only be used in common module sources
|
||||||
|
|
||||||
|
================ Step #4 remove @Optional from JVM =================
|
||||||
|
|
||||||
|
Building c
|
||||||
|
Building pJs
|
||||||
|
Exit code: NOTHING_DONE
|
||||||
|
------------------------------------------
|
||||||
|
Building pJvm
|
||||||
|
Exit code: NOTHING_DONE
|
||||||
|
------------------------------------------
|
||||||
|
|
||||||
|
================ Step #5 add another @Optional in Common module =================
|
||||||
|
|
||||||
|
Building c
|
||||||
|
Building pJs
|
||||||
|
Compiling files:
|
||||||
|
c/src/b.kt
|
||||||
|
End of files
|
||||||
|
Exit code: OK
|
||||||
|
------------------------------------------
|
||||||
|
Building pJvm
|
||||||
|
Compiling files:
|
||||||
|
c/src/b.kt
|
||||||
|
End of files
|
||||||
|
Exit code: OK
|
||||||
|
------------------------------------------
|
||||||
Vendored
+7
@@ -0,0 +1,7 @@
|
|||||||
|
@file:Suppress("EXPERIMENTAL_API_USAGE_ERROR")
|
||||||
|
|
||||||
|
@OptionalExpectation
|
||||||
|
expect annotation class Optional(val value: String)
|
||||||
|
|
||||||
|
@Optional("Foo")
|
||||||
|
class Foo
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
@Optional("Foo")
|
||||||
|
class Bar
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
// Should be an error: Declaration annotated with '@OptionalExpectation' can only be used in common module sources
|
||||||
|
@Optional("BarJs")
|
||||||
|
class BarJs
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
// Should be an error: Declaration annotated with '@OptionalExpectation' can only be used in common module sources
|
||||||
|
@Optional("BarJvm")
|
||||||
|
class BarJvm
|
||||||
Reference in New Issue
Block a user