JPS: Add tests for mpp complementary files tracking after build error (KT-27868)
This commit is contained in:
+36
@@ -579,11 +579,47 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("buildError")
|
||||
public void testBuildError() throws Exception {
|
||||
runTest("jps-plugin/testData/incremental/multiModule/multiplatform/custom/buildError/");
|
||||
}
|
||||
|
||||
@TestMetadata("buildError2Levels")
|
||||
public void testBuildError2Levels() throws Exception {
|
||||
runTest("jps-plugin/testData/incremental/multiModule/multiplatform/custom/buildError2Levels/");
|
||||
}
|
||||
|
||||
@TestMetadata("commonSourcesCompilerArg")
|
||||
public void testCommonSourcesCompilerArg() throws Exception {
|
||||
runTest("jps-plugin/testData/incremental/multiModule/multiplatform/custom/commonSourcesCompilerArg/");
|
||||
}
|
||||
|
||||
@TestMetadata("jps-plugin/testData/incremental/multiModule/multiplatform/custom/buildError")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class BuildError extends AbstractIncrementalJpsTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInBuildError() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/buildError"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("jps-plugin/testData/incremental/multiModule/multiplatform/custom/buildError2Levels")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class BuildError2Levels extends AbstractIncrementalJpsTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInBuildError2Levels() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/buildError2Levels"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("jps-plugin/testData/incremental/multiModule/multiplatform/custom/commonSourcesCompilerArg")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
c [sourceSetHolder]
|
||||
|
||||
pJvm [compilationAndSourceSetHolder, jvm]
|
||||
pJvm -> c [include]
|
||||
|
||||
pJs [compilationAndSourceSetHolder, js]
|
||||
pJs -> c [include]
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
make compilation fail
|
||||
fix error
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
================ Step #1 make compilation fail =================
|
||||
|
||||
Building c
|
||||
Building pJs
|
||||
Cleaning output files:
|
||||
out/production/pJs/pJs.js
|
||||
out/production/pJs/pJs.meta.js
|
||||
out/production/pJs/pJs/root-package.kjsm
|
||||
End of files
|
||||
Compiling files:
|
||||
c/src/a.kt
|
||||
pJs/src/c.kt
|
||||
End of files
|
||||
Exit code: ABORT
|
||||
------------------------------------------
|
||||
COMPILATION FAILED
|
||||
[pJs] Expecting a top level declaration
|
||||
[pJs] Expecting a top level declaration
|
||||
|
||||
================ Step #2 fix error =================
|
||||
|
||||
Building c
|
||||
Building pJs
|
||||
Compiling files:
|
||||
c/src/a.kt
|
||||
pJs/src/c.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
Building pJvm
|
||||
Cleaning output files:
|
||||
out/production/pJvm/META-INF/pJvm.kotlin_module
|
||||
End of files
|
||||
Compiling files:
|
||||
c/src/a.kt
|
||||
pJvm/src/c.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
+1
@@ -0,0 +1 @@
|
||||
expect fun f()
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
:(
|
||||
|
||||
expect fun f()
|
||||
+1
@@ -0,0 +1 @@
|
||||
expect fun f()
|
||||
+1
@@ -0,0 +1 @@
|
||||
actual fun f() = Unit
|
||||
+1
@@ -0,0 +1 @@
|
||||
actual fun f() = Unit
|
||||
jps-plugin/testData/incremental/multiModule/multiplatform/custom/buildError2Levels/_dependencies.txt
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
c [sourceSetHolder]
|
||||
|
||||
pJvm [compilationAndSourceSetHolder, jvm]
|
||||
pJvm -> c [include]
|
||||
|
||||
pJs [compilationAndSourceSetHolder, js]
|
||||
pJs -> c [include]
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
make compilation fail
|
||||
fix error
|
||||
Vendored
+44
@@ -0,0 +1,44 @@
|
||||
================ Step #1 make compilation fail =================
|
||||
|
||||
Building c
|
||||
Building pJs
|
||||
Cleaning output files:
|
||||
out/production/pJs/pJs.js
|
||||
out/production/pJs/pJs.meta.js
|
||||
out/production/pJs/pJs/root-package.kjsm
|
||||
End of files
|
||||
Compiling files:
|
||||
c/src/a.kt
|
||||
c/src/b.kt
|
||||
pJs/src/c.kt
|
||||
End of files
|
||||
Exit code: ABORT
|
||||
------------------------------------------
|
||||
COMPILATION FAILED
|
||||
[pJs] Expecting a top level declaration
|
||||
[pJs] Expecting a top level declaration
|
||||
|
||||
================ Step #2 fix error =================
|
||||
|
||||
Building c
|
||||
Building pJs
|
||||
Compiling files:
|
||||
c/src/a.kt
|
||||
c/src/b.kt
|
||||
pJs/src/c.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
Marked as dirty by Kotlin:
|
||||
c/src/b.kt
|
||||
Building pJvm
|
||||
Cleaning output files:
|
||||
out/production/pJvm/META-INF/pJvm.kotlin_module
|
||||
End of files
|
||||
Compiling files:
|
||||
c/src/a.kt
|
||||
c/src/b.kt
|
||||
pJvm/src/c.kt
|
||||
End of files
|
||||
Exit code: OK
|
||||
------------------------------------------
|
||||
+1
@@ -0,0 +1 @@
|
||||
expect fun f()
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
:(
|
||||
|
||||
expect fun f()
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
expect fun f()
|
||||
+1
@@ -0,0 +1 @@
|
||||
expect fun g()
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
actual fun f() = Unit
|
||||
|
||||
actual fun g() = Unit
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
actual fun f() = Unit
|
||||
|
||||
actual fun g() = Unit
|
||||
Reference in New Issue
Block a user