diff --git a/compiler/testData/cli/js/emptySources.args b/compiler/testData/cli/js/emptySources.args new file mode 100644 index 00000000000..ff55379f3a4 --- /dev/null +++ b/compiler/testData/cli/js/emptySources.args @@ -0,0 +1,4 @@ +$TEMP_DIR$ +-no-stdlib +-output +$TESTDATA_DIR$ diff --git a/compiler/testData/cli/js/emptySources.out b/compiler/testData/cli/js/emptySources.out new file mode 100644 index 00000000000..abdeccce196 --- /dev/null +++ b/compiler/testData/cli/js/emptySources.out @@ -0,0 +1,2 @@ +ERROR: No source files +COMPILATION_ERROR \ No newline at end of file diff --git a/compiler/testData/cli/js/nonExistingSourcePath.args b/compiler/testData/cli/js/nonExistingSourcePath.args new file mode 100644 index 00000000000..c72e43053ee --- /dev/null +++ b/compiler/testData/cli/js/nonExistingSourcePath.args @@ -0,0 +1,4 @@ +not/existing/path +-no-stdlib +-output +$TESTDATA_DIR$ diff --git a/compiler/testData/cli/js/nonExistingSourcePath.out b/compiler/testData/cli/js/nonExistingSourcePath.out new file mode 100644 index 00000000000..4388c9034a6 --- /dev/null +++ b/compiler/testData/cli/js/nonExistingSourcePath.out @@ -0,0 +1,2 @@ +ERROR: Source file or directory not found: not/existing/path +COMPILATION_ERROR \ No newline at end of file diff --git a/compiler/testData/cli/jvm/emptySources.args b/compiler/testData/cli/jvm/emptySources.args new file mode 100644 index 00000000000..e5860c7e9c4 --- /dev/null +++ b/compiler/testData/cli/jvm/emptySources.args @@ -0,0 +1,3 @@ +$TEMP_DIR$ +-d +$TEMP_DIR$ \ No newline at end of file diff --git a/compiler/testData/cli/jvm/emptySources.out b/compiler/testData/cli/jvm/emptySources.out new file mode 100644 index 00000000000..abdeccce196 --- /dev/null +++ b/compiler/testData/cli/jvm/emptySources.out @@ -0,0 +1,2 @@ +ERROR: No source files +COMPILATION_ERROR \ No newline at end of file diff --git a/compiler/testData/integration/ant/jvm/noStdlibForJavac/build.log.expected b/compiler/testData/integration/ant/jvm/noStdlibForJavac/build.log.expected index b482a8f7883..9242db7b8e2 100644 --- a/compiler/testData/integration/ant/jvm/noStdlibForJavac/build.log.expected +++ b/compiler/testData/integration/ant/jvm/noStdlibForJavac/build.log.expected @@ -4,7 +4,6 @@ Buildfile: [TestData]/build.xml build: [mkdir] Created dir: [Temp]/classes [javac] Compiling 1 source file to [Temp]/classes - [javac] Compiling [[TestData]] => [[Temp]/classes] [javac] Running javac... [javac] [TestData]/J.java:3: package kotlin does not exist [javac] import kotlin.Unit; diff --git a/compiler/testData/integration/ant/jvm/stdlibForJavacWithNoKotlin/J.java b/compiler/testData/integration/ant/jvm/stdlibForJavacWithNoKotlin/J.java new file mode 100644 index 00000000000..e14525bb20b --- /dev/null +++ b/compiler/testData/integration/ant/jvm/stdlibForJavacWithNoKotlin/J.java @@ -0,0 +1,5 @@ +package test; + +import kotlin.Unit; + +public class J {} diff --git a/compiler/testData/integration/ant/jvm/stdlibForJavacWithNoKotlin/build.log.expected b/compiler/testData/integration/ant/jvm/stdlibForJavacWithNoKotlin/build.log.expected new file mode 100644 index 00000000000..139e86ef418 --- /dev/null +++ b/compiler/testData/integration/ant/jvm/stdlibForJavacWithNoKotlin/build.log.expected @@ -0,0 +1,12 @@ +OUT: +Buildfile: [TestData]/build.xml + +build: + [mkdir] Created dir: [Temp]/classes + [javac] Compiling 1 source file to [Temp]/classes + [javac] Running javac... + +BUILD SUCCESSFUL +Total time: [time] + +Return code: 0 diff --git a/compiler/testData/integration/ant/jvm/stdlibForJavacWithNoKotlin/build.xml b/compiler/testData/integration/ant/jvm/stdlibForJavacWithNoKotlin/build.xml new file mode 100644 index 00000000000..d0daf057d0e --- /dev/null +++ b/compiler/testData/integration/ant/jvm/stdlibForJavacWithNoKotlin/build.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/compiler/tests/org/jetbrains/kotlin/cli/KotlincExecutableTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/cli/KotlincExecutableTestGenerated.java index 435ff1185ff..23ad7e546e4 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/KotlincExecutableTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/cli/KotlincExecutableTestGenerated.java @@ -67,6 +67,12 @@ public class KotlincExecutableTestGenerated extends AbstractKotlincExecutableTes doJvmTest(fileName); } + @TestMetadata("emptySources.args") + public void testEmptySources() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/cli/jvm/emptySources.args"); + doJvmTest(fileName); + } + @TestMetadata("extraHelp.args") public void testExtraHelp() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/cli/jvm/extraHelp.args"); @@ -214,6 +220,12 @@ public class KotlincExecutableTestGenerated extends AbstractKotlincExecutableTes doJsTest(fileName); } + @TestMetadata("emptySources.args") + public void testEmptySources() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/cli/js/emptySources.args"); + doJsTest(fileName); + } + @TestMetadata("inlineCycle.args") public void testInlineCycle() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/cli/js/inlineCycle.args"); @@ -238,6 +250,12 @@ public class KotlincExecutableTestGenerated extends AbstractKotlincExecutableTes doJsTest(fileName); } + @TestMetadata("nonExistingSourcePath.args") + public void testNonExistingSourcePath() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/cli/js/nonExistingSourcePath.args"); + doJsTest(fileName); + } + @TestMetadata("notValidLibraryDir.args") public void testNotValidLibraryDir() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/cli/js/notValidLibraryDir.args"); diff --git a/compiler/tests/org/jetbrains/kotlin/cli/js/K2JsCliTest.java b/compiler/tests/org/jetbrains/kotlin/cli/js/K2JsCliTest.java index 2f173963277..31354b358d0 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/js/K2JsCliTest.java +++ b/compiler/tests/org/jetbrains/kotlin/cli/js/K2JsCliTest.java @@ -37,6 +37,20 @@ public class K2JsCliTest extends CliBaseTest { Assert.assertFalse(new File(tmpdir.getTmpDir(), "out.js").exists()); } + @Test + public void nonExistingSourcePath() throws Exception { + executeCompilerCompareOutputJS(); + + Assert.assertFalse(new File(tmpdir.getTmpDir(), "out.js").exists()); + } + + @Test + public void emptySources() throws Exception { + executeCompilerCompareOutputJS(); + + Assert.assertFalse(new File(tmpdir.getTmpDir(), "out.js").exists()); + } + @Test public void outputPrefixFileNotFound() throws Exception { executeCompilerCompareOutputJS(); diff --git a/compiler/tests/org/jetbrains/kotlin/cli/jvm/K2JvmCliTest.java b/compiler/tests/org/jetbrains/kotlin/cli/jvm/K2JvmCliTest.java index 123a4bab9d2..3438a627af9 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/jvm/K2JvmCliTest.java +++ b/compiler/tests/org/jetbrains/kotlin/cli/jvm/K2JvmCliTest.java @@ -47,6 +47,11 @@ public class K2JvmCliTest extends CliBaseTest { executeCompilerCompareOutputJVM(); } + @Test + public void emptySources() throws Exception { + executeCompilerCompareOutputJVM(); + } + @Test public void classpath() throws Exception { executeCompilerCompareOutputJVM(); diff --git a/compiler/tests/org/jetbrains/kotlin/integration/AntTaskTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/integration/AntTaskTestGenerated.java index 68a208950ea..f000c6b7f7f 100644 --- a/compiler/tests/org/jetbrains/kotlin/integration/AntTaskTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/integration/AntTaskTestGenerated.java @@ -65,6 +65,12 @@ public class AntTaskTestGenerated extends AbstractAntTaskTest { doTest(fileName); } + @TestMetadata("stdlibForJavacWithNoKotlin") + public void testStdlibForJavacWithNoKotlin() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/integration/ant/jvm/stdlibForJavacWithNoKotlin/"); + doTest(fileName); + } + @TestMetadata("suppressWarnings") public void testSuppressWarnings() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/integration/ant/jvm/suppressWarnings/");