From 56d5846ef11e3a3ad353cc591f79f5951a112e39 Mon Sep 17 00:00:00 2001 From: Alexey Tsvetkov Date: Tue, 23 Apr 2019 21:28:54 +0300 Subject: [PATCH] Add test for KT-31131 --- ...rementalJvmCompilerRunnerTestGenerated.java | 18 ++++++++++++++++++ .../build/IncrementalJvmJpsTestGenerated.java | 18 ++++++++++++++++++ .../multifilePartsWithProperties/build.log | 12 ++++++++++++ .../multifilePartsWithProperties/partA.kt | 4 ++++ .../multifilePartsWithProperties/partB.kt | 4 ++++ .../partB.kt.new.1 | 4 ++++ 6 files changed, 60 insertions(+) create mode 100644 jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/build.log create mode 100644 jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/partA.kt create mode 100644 jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/partB.kt create mode 100644 jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/partB.kt.new.1 diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunnerTestGenerated.java b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunnerTestGenerated.java index 8b3bc1d058c..da0fe4947e2 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunnerTestGenerated.java +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunnerTestGenerated.java @@ -2014,6 +2014,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement runTest("jps-plugin/testData/incremental/withJava/other/multifilePackagePartMethodAdded/"); } + @TestMetadata("multifilePartsWithProperties") + public void testMultifilePartsWithProperties() throws Exception { + runTest("jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/"); + } + @TestMetadata("optionalParameter") public void testOptionalParameter() throws Exception { runTest("jps-plugin/testData/incremental/withJava/other/optionalParameter/"); @@ -2322,6 +2327,19 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement } } + @TestMetadata("jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class MultifilePartsWithProperties extends AbstractIncrementalJvmCompilerRunnerTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInMultifilePartsWithProperties() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true); + } + } + @TestMetadata("jps-plugin/testData/incremental/withJava/other/optionalParameter") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalJvmJpsTestGenerated.java b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalJvmJpsTestGenerated.java index 0ca6c312067..5cfcddd4959 100644 --- a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalJvmJpsTestGenerated.java +++ b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalJvmJpsTestGenerated.java @@ -2192,6 +2192,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes runTest("jps-plugin/testData/incremental/withJava/other/multifilePackagePartMethodAdded/"); } + @TestMetadata("multifilePartsWithProperties") + public void testMultifilePartsWithProperties() throws Exception { + runTest("jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/"); + } + @TestMetadata("optionalParameter") public void testOptionalParameter() throws Exception { runTest("jps-plugin/testData/incremental/withJava/other/optionalParameter/"); @@ -2500,6 +2505,19 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes } } + @TestMetadata("jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class MultifilePartsWithProperties extends AbstractIncrementalJvmJpsTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInMultifilePartsWithProperties() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties"), Pattern.compile("^([^\\.]+)$"), TargetBackend.ANY, true); + } + } + @TestMetadata("jps-plugin/testData/incremental/withJava/other/optionalParameter") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/build.log b/jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/build.log new file mode 100644 index 00000000000..0a12cb05907 --- /dev/null +++ b/jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/build.log @@ -0,0 +1,12 @@ +================ Step #1 ================= + +Cleaning output files: + out/production/module/META-INF/module.kotlin_module + out/production/module/Utils.class + out/production/module/Utils__PartBKt.class +End of files +Compiling files: + src/partB.kt +End of files +Exit code: OK +------------------------------------------ \ No newline at end of file diff --git a/jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/partA.kt b/jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/partA.kt new file mode 100644 index 00000000000..457823b86a7 --- /dev/null +++ b/jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/partA.kt @@ -0,0 +1,4 @@ +@file:JvmName("Utils") +@file:JvmMultifileClass + +val aVal: Int get() = 0 \ No newline at end of file diff --git a/jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/partB.kt b/jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/partB.kt new file mode 100644 index 00000000000..a180e128110 --- /dev/null +++ b/jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/partB.kt @@ -0,0 +1,4 @@ +@file:JvmName("Utils") +@file:JvmMultifileClass + +val bVal: Int get() = 0 \ No newline at end of file diff --git a/jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/partB.kt.new.1 b/jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/partB.kt.new.1 new file mode 100644 index 00000000000..258dff7e9f7 --- /dev/null +++ b/jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties/partB.kt.new.1 @@ -0,0 +1,4 @@ +@file:JvmName("Utils") +@file:JvmMultifileClass + +val bVal: Int get() = 1 \ No newline at end of file