JPS: Test for "Cyclically dependent modules should have same compiler"

KT-27285
This commit is contained in:
Sergey Rostov
2018-11-26 09:12:14 +03:00
parent 3c8b15ca54
commit c06b000e8d
5 changed files with 30 additions and 0 deletions
@@ -594,6 +594,11 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
runTest("jps-plugin/testData/incremental/multiModule/multiplatform/custom/commonSourcesCompilerArg/");
}
@TestMetadata("notSameCompiler")
public void testNotSameCompiler() throws Exception {
runTest("jps-plugin/testData/incremental/multiModule/multiplatform/custom/notSameCompiler/");
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/multiplatform/custom/buildError")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -632,6 +637,19 @@ public class IncrementalJpsTestGenerated extends AbstractIncrementalJpsTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/commonSourcesCompilerArg"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
}
}
@TestMetadata("jps-plugin/testData/incremental/multiModule/multiplatform/custom/notSameCompiler")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class NotSameCompiler extends AbstractIncrementalJpsTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInNotSameCompiler() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/notSameCompiler"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true);
}
}
}
@TestMetadata("jps-plugin/testData/incremental/pureKotlin")
@@ -0,0 +1,5 @@
pJvm [jvm]
pJs [js]
pJs -> pJvm [compile]
pJvm -> pJs [compile]
@@ -0,0 +1,5 @@
Building pJs, pJvm
Exit code: ABORT
------------------------------------------
COMPILATION FAILED
Cyclically dependent modules pJvm (jvm), pJs (js) should have same compiler.
@@ -0,0 +1 @@
fun f() = 1
@@ -0,0 +1 @@
fun g() = 2