From 1d6836f6aa6b5f7f533e949b81cf6d381d9f166b Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Mon, 4 Mar 2013 15:29:19 +0400 Subject: [PATCH] Added CLI tests with non-existing paths. --- ...nonExistingClassPathAndAnnotationsPath.out | 3 +++ .../testData/cli/nonExistingSourcePath.out | 2 ++ .../org/jetbrains/jet/cli/jvm/CliTest.java | 20 +++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 compiler/testData/cli/nonExistingClassPathAndAnnotationsPath.out create mode 100644 compiler/testData/cli/nonExistingSourcePath.out diff --git a/compiler/testData/cli/nonExistingClassPathAndAnnotationsPath.out b/compiler/testData/cli/nonExistingClassPathAndAnnotationsPath.out new file mode 100644 index 0000000000000..2503aae0888cd --- /dev/null +++ b/compiler/testData/cli/nonExistingClassPathAndAnnotationsPath.out @@ -0,0 +1,3 @@ +WARNING: Classpath entry points to a non-existent location: not/existing/path +WARNING: Annotations path entry points to a non-existent location: yet/another/not/existing/path +OK diff --git a/compiler/testData/cli/nonExistingSourcePath.out b/compiler/testData/cli/nonExistingSourcePath.out new file mode 100644 index 0000000000000..ef3a3fdb9896e --- /dev/null +++ b/compiler/testData/cli/nonExistingSourcePath.out @@ -0,0 +1,2 @@ +ERROR: Source file or directory not found: not/existing/path +COMPILATION_ERROR diff --git a/compiler/tests/org/jetbrains/jet/cli/jvm/CliTest.java b/compiler/tests/org/jetbrains/jet/cli/jvm/CliTest.java index 7628462226422..1b79b2a7169d6 100644 --- a/compiler/tests/org/jetbrains/jet/cli/jvm/CliTest.java +++ b/compiler/tests/org/jetbrains/jet/cli/jvm/CliTest.java @@ -173,6 +173,26 @@ public void printArguments() { } } + @Test + public void nonExistingClassPathAndAnnotationsPath() { + String[] args = { + "-src", "compiler/testData/cli/simple.kt", + "-classpath", "not/existing/path", + "-annotations", "yet/another/not/existing/path", + "-output", tmpdir.getTmpDir().getPath()}; + executeCompilerCompareOutput(args); + + Assert.assertTrue(new File(tmpdir.getTmpDir(), PackageClassUtils.getPackageClassName(FqName.ROOT) + ".class").isFile()); + } + + @Test + public void nonExistingSourcePath() { + String[] args = { + "-src", "not/existing/path", + "-output", tmpdir.getTmpDir().getPath()}; + executeCompilerCompareOutput(args); + } + @Test public void testScript() { LinkedList scriptParameters = new LinkedList();