From 19feacb96bbb8d73290b62d740fbd2728eb4869a Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Thu, 2 Aug 2018 15:00:15 +0200 Subject: [PATCH] Minor, expand TESTDATA_DIR with absolute path in CLI tests To be able to use it correctly inside an xml build file where, if the path is not absolute, it's treated as relative to the build file path (which is TMP_DIR in several tests of the subsequent commit) --- compiler/testData/cli/js-dce/parseError.out | 2 +- compiler/testData/cli/js/outputIsDirectory.out | 2 +- compiler/testData/cli/js/wrongAbiVersion.out | 2 +- compiler/testData/cli/jvm/duplicateSources.out | 2 +- compiler/testData/cli/jvm/jdkPathDoesNotExist.out | 2 +- compiler/testData/cli/jvm/wrongJdkPath.out | 2 +- .../tests/org/jetbrains/kotlin/cli/AbstractCliTest.java | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/testData/cli/js-dce/parseError.out b/compiler/testData/cli/js-dce/parseError.out index 18285d04238..8ef4b3d95f2 100644 --- a/compiler/testData/cli/js-dce/parseError.out +++ b/compiler/testData/cli/js-dce/parseError.out @@ -1,2 +1,2 @@ -error: at compiler/testData/cli/js-dce/parseError.js (1, 1): syntax error +error: at $TESTDATA_DIR$/parseError.js (1, 1): syntax error COMPILATION_ERROR diff --git a/compiler/testData/cli/js/outputIsDirectory.out b/compiler/testData/cli/js/outputIsDirectory.out index 5adeb42578b..e08cc42ef6f 100644 --- a/compiler/testData/cli/js/outputIsDirectory.out +++ b/compiler/testData/cli/js/outputIsDirectory.out @@ -1,2 +1,2 @@ -error: cannot open output file 'compiler/testData/cli/js': is a directory +error: cannot open output file '$TESTDATA_DIR$': is a directory COMPILATION_ERROR diff --git a/compiler/testData/cli/js/wrongAbiVersion.out b/compiler/testData/cli/js/wrongAbiVersion.out index 82e0584333c..963fa870506 100644 --- a/compiler/testData/cli/js/wrongAbiVersion.out +++ b/compiler/testData/cli/js/wrongAbiVersion.out @@ -1,2 +1,2 @@ -error: file 'compiler/testData/cli/js/wrongAbiVersionLib/wrongAbiLib.meta.js' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 0.0.0, expected version is $ABI_VERSION$ +error: file '$TESTDATA_DIR$/wrongAbiVersionLib/wrongAbiLib.meta.js' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 0.0.0, expected version is $ABI_VERSION$ COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/duplicateSources.out b/compiler/testData/cli/jvm/duplicateSources.out index a6aa448ff9a..114c9c9b78b 100644 --- a/compiler/testData/cli/jvm/duplicateSources.out +++ b/compiler/testData/cli/jvm/duplicateSources.out @@ -1,2 +1,2 @@ -warning: duplicate source root: compiler/testData/cli/jvm/simple.kt +warning: duplicate source root: $TESTDATA_DIR$/simple.kt OK diff --git a/compiler/testData/cli/jvm/jdkPathDoesNotExist.out b/compiler/testData/cli/jvm/jdkPathDoesNotExist.out index 155c2f6891b..6262a6ebed6 100644 --- a/compiler/testData/cli/jvm/jdkPathDoesNotExist.out +++ b/compiler/testData/cli/jvm/jdkPathDoesNotExist.out @@ -1,2 +1,2 @@ -error: JDK home directory does not exist: compiler/testData/cli/jvm/abacaba +error: JDK home directory does not exist: $TESTDATA_DIR$/abacaba COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/wrongJdkPath.out b/compiler/testData/cli/jvm/wrongJdkPath.out index 00cbb19e373..6beeb39f221 100644 --- a/compiler/testData/cli/jvm/wrongJdkPath.out +++ b/compiler/testData/cli/jvm/wrongJdkPath.out @@ -1,2 +1,2 @@ -error: no class roots are found in the JDK path: compiler/testData/cli/jvm +error: no class roots are found in the JDK path: $TESTDATA_DIR$ COMPILATION_ERROR diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/cli/AbstractCliTest.java b/compiler/tests-common/tests/org/jetbrains/kotlin/cli/AbstractCliTest.java index b0457c29d92..5d41d96929c 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/cli/AbstractCliTest.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/cli/AbstractCliTest.java @@ -185,7 +185,7 @@ public abstract class AbstractCliTest extends TestCaseWithTmpdir { private static List readArgs(@NotNull String testArgsFilePath, @NotNull String tempDir) { File testArgsFile = new File(testArgsFilePath); List lines = FilesKt.readLines(testArgsFile, Charsets.UTF_8); - return CollectionsKt.mapNotNull(lines, arg -> readArg(arg, testArgsFile.getParent(), tempDir)); + return CollectionsKt.mapNotNull(lines, arg -> readArg(arg, testArgsFile.getParentFile().getAbsolutePath(), tempDir)); } private static String readArg(String arg, @NotNull String testDataDir, @NotNull String tempDir) {