diff --git a/compiler/testData/cli/js/emptySources.args b/compiler/testData/cli/js/emptySources.args index 81cd80e1564..d0d98f405e9 100644 --- a/compiler/testData/cli/js/emptySources.args +++ b/compiler/testData/cli/js/emptySources.args @@ -1,5 +1,9 @@ $TEMP_DIR$ --Xforce-deprecated-legacy-compiler-usage --no-stdlib --output -$TESTDATA_DIR$ +-Xir-only +-Xir-produce-klib-dir +-libraries +$STDLIB_JS$ +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out diff --git a/compiler/testData/cli/js/kotlinHomeWithoutStdlib.args b/compiler/testData/cli/js/kotlinHomeWithoutStdlib.args deleted file mode 100644 index 81d2956508d..00000000000 --- a/compiler/testData/cli/js/kotlinHomeWithoutStdlib.args +++ /dev/null @@ -1,6 +0,0 @@ -$TESTDATA_DIR$/simple2js.kt --Xforce-deprecated-legacy-compiler-usage --kotlin-home -$TESTDATA_DIR$ --output -$TEMP_DIR$/out.js diff --git a/compiler/testData/cli/js/kotlinHomeWithoutStdlib.out b/compiler/testData/cli/js/kotlinHomeWithoutStdlib.out deleted file mode 100644 index 603286d47ac..00000000000 --- a/compiler/testData/cli/js/kotlinHomeWithoutStdlib.out +++ /dev/null @@ -1,2 +0,0 @@ -warning: unable to find kotlin-stdlib-js.jar in the Kotlin home directory. Pass either '-no-stdlib' to prevent adding it to the classpath, or the correct '-kotlin-home' -OK diff --git a/compiler/testData/cli/js/legacyCompilerUsageWithoutFlag.args b/compiler/testData/cli/js/legacyCompilerUsageWithoutFlag.args deleted file mode 100644 index d99fe90b79c..00000000000 --- a/compiler/testData/cli/js/legacyCompilerUsageWithoutFlag.args +++ /dev/null @@ -1,3 +0,0 @@ -$TESTDATA_DIR$/simple2js.kt --output -$TEMP_DIR$/out.js diff --git a/compiler/testData/cli/js/legacyCompilerUsageWithoutFlag.out b/compiler/testData/cli/js/legacyCompilerUsageWithoutFlag.out deleted file mode 100644 index a33af2c6697..00000000000 --- a/compiler/testData/cli/js/legacyCompilerUsageWithoutFlag.out +++ /dev/null @@ -1,2 +0,0 @@ -error: old Kotlin/JS compiler is no longer supported. Please migrate to the new JS IR backend -COMPILATION_ERROR diff --git a/compiler/testData/cli/js/nonExistingSourcePath.args b/compiler/testData/cli/js/nonExistingSourcePath.args index c607a46afc3..aa519dac6c9 100644 --- a/compiler/testData/cli/js/nonExistingSourcePath.args +++ b/compiler/testData/cli/js/nonExistingSourcePath.args @@ -1,5 +1,9 @@ not/existing/path --no-stdlib --Xforce-deprecated-legacy-compiler-usage --output -$TESTDATA_DIR$ +-Xir-only +-Xir-produce-klib-dir +-libraries +$STDLIB_JS$ +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out diff --git a/compiler/testData/cli/js/perFileWithValidModuleKind.args b/compiler/testData/cli/js/perFileWithValidModuleKind.args index abb8af0e440..00ee5a7a704 100644 --- a/compiler/testData/cli/js/perFileWithValidModuleKind.args +++ b/compiler/testData/cli/js/perFileWithValidModuleKind.args @@ -1,5 +1,7 @@ $TESTDATA_DIR$/simple2js.kt -Xir-only +-libraries +$STDLIB_JS$ -ir-output-dir $TEMP_DIR$ -ir-output-name diff --git a/compiler/testData/cli/js/sourceMap.args b/compiler/testData/cli/js/sourceMap.args index aa073041d2e..4e7bec8a45a 100644 --- a/compiler/testData/cli/js/sourceMap.args +++ b/compiler/testData/cli/js/sourceMap.args @@ -1,8 +1,18 @@ $TESTDATA_DIR$/sourceMap.kt +-Xir-produce-klib-dir +-Xir-only +-libraries +$STDLIB_JS$ +-ir-output-dir +$TEMP_DIR$/klib +-ir-output-name +out +--- -Xir-produce-js -Xir-only -libraries $STDLIB_JS$ +-Xinclude=$TEMP_DIR$/klib -source-map -source-map-prefix ./ diff --git a/compiler/testData/cli/js/sourceMapCharEscape.args b/compiler/testData/cli/js/sourceMapCharEscape.args index 291992255d1..72d49d6d100 100644 --- a/compiler/testData/cli/js/sourceMapCharEscape.args +++ b/compiler/testData/cli/js/sourceMapCharEscape.args @@ -1,8 +1,18 @@ $TESTDATA_DIR$/sourceMapCharEscape.kt +-Xir-produce-klib-dir +-Xir-only +-libraries +$STDLIB_JS$ +-ir-output-dir +$TEMP_DIR$/klib +-ir-output-name +out +--- -Xir-produce-js -Xir-only -libraries $STDLIB_JS$ +-Xinclude=$TEMP_DIR$/klib -source-map -source-map-embed-sources always diff --git a/compiler/testData/cli/js/sourceMapDuplicateRelativePaths.args b/compiler/testData/cli/js/sourceMapDuplicateRelativePaths.args index 77625b229d2..01f8c263bae 100644 --- a/compiler/testData/cli/js/sourceMapDuplicateRelativePaths.args +++ b/compiler/testData/cli/js/sourceMapDuplicateRelativePaths.args @@ -1,8 +1,18 @@ $TESTDATA_DIR$/sourceMapDuplicatePath/ +-Xir-produce-klib-dir +-Xir-only +-libraries +$STDLIB_JS$ +-ir-output-dir +$TEMP_DIR$/klib +-ir-output-name +out +--- -Xir-produce-js -Xir-only -libraries $STDLIB_JS$ +-Xinclude=$TEMP_DIR$/klib -source-map -source-map-base-dirs $TESTDATA_DIR$/sourceMapDuplicatePath/foo:$TESTDATA_DIR$/sourceMapDuplicatePath/bar diff --git a/compiler/testData/cli/js/sourceMapEmbedSources.args b/compiler/testData/cli/js/sourceMapEmbedSources.args index 4e9fc7cc180..10978159ecc 100644 --- a/compiler/testData/cli/js/sourceMapEmbedSources.args +++ b/compiler/testData/cli/js/sourceMapEmbedSources.args @@ -1,8 +1,18 @@ $TESTDATA_DIR$/sourceMap.kt +-Xir-produce-klib-dir +-Xir-only +-libraries +$STDLIB_JS$ +-ir-output-dir +$TEMP_DIR$/klib +-ir-output-name +out +--- -Xir-produce-js -Xir-only -libraries $STDLIB_JS$ +-Xinclude=$TEMP_DIR$/klib -source-map -source-map-prefix ./ diff --git a/compiler/testData/cli/js/sourceMapPrefix.args b/compiler/testData/cli/js/sourceMapPrefix.args index fc518e49aec..2c0ad53bcf4 100644 --- a/compiler/testData/cli/js/sourceMapPrefix.args +++ b/compiler/testData/cli/js/sourceMapPrefix.args @@ -1,8 +1,18 @@ $TESTDATA_DIR$/sourceMap.kt +-Xir-produce-klib-dir +-Xir-only +-libraries +$STDLIB_JS$ +-ir-output-dir +$TEMP_DIR$/klib +-ir-output-name +out +--- -Xir-produce-js -Xir-only -libraries $STDLIB_JS$ +-Xinclude=$TEMP_DIR$/klib -source-map -source-map-prefix /localhost/src/ diff --git a/compiler/testData/cli/js/sourceMapRelativeRoot.args b/compiler/testData/cli/js/sourceMapRelativeRoot.args index e1557415c22..0951146a92f 100644 --- a/compiler/testData/cli/js/sourceMapRelativeRoot.args +++ b/compiler/testData/cli/js/sourceMapRelativeRoot.args @@ -10,10 +10,20 @@ $TESTDATA_DIR$/sourceMapRelativeRoot/lib/out lib --- $TESTDATA_DIR$/sourceMapRelativeRoot/main/src/main.kt +-Xir-produce-klib-dir +-Xir-only +-libraries +$STDLIB_JS$:$TESTDATA_DIR$/sourceMapRelativeRoot/lib/out/ +-ir-output-dir +$TEMP_DIR$/klib +-ir-output-name +main +--- -Xir-produce-js -Xir-only -libraries $STDLIB_JS$:$TESTDATA_DIR$/sourceMapRelativeRoot/lib/out/ +-Xinclude=$TEMP_DIR$/klib -source-map -ir-output-dir $TESTDATA_DIR$/sourceMapRelativeRoot/main/out diff --git a/compiler/testData/cli/js/sourceMapRootAuto.args b/compiler/testData/cli/js/sourceMapRootAuto.args deleted file mode 100644 index 8d6f8578120..00000000000 --- a/compiler/testData/cli/js/sourceMapRootAuto.args +++ /dev/null @@ -1,13 +0,0 @@ -$TESTDATA_DIR$/sourceMapRoot/foo/file1.kt -$TESTDATA_DIR$/sourceMapRoot/bar/file2.kt --Xir-produce-js --Xir-only --libraries -$STDLIB_JS$ --source-map --source-map-prefix -./ --ir-output-dir -$TEMP_DIR$ --ir-output-name -out diff --git a/compiler/testData/cli/js/sourceMapRootAuto.out b/compiler/testData/cli/js/sourceMapRootAuto.out deleted file mode 100644 index 15a9042e343..00000000000 --- a/compiler/testData/cli/js/sourceMapRootAuto.out +++ /dev/null @@ -1,4 +0,0 @@ -info: produce executable: $TMP_DIR$ -info: cache directory: null -info: executable production duration: [time] -OK \ No newline at end of file diff --git a/compiler/testData/cli/js/sourceMapRootAuto.test b/compiler/testData/cli/js/sourceMapRootAuto.test deleted file mode 100644 index 72135eb65ec..00000000000 --- a/compiler/testData/cli/js/sourceMapRootAuto.test +++ /dev/null @@ -1,3 +0,0 @@ -// EXISTS: out.js -// CONTAINS: out.js.map, "./foo/file1.kt" -// CONTAINS: out.js.map, "./bar/file2.kt" diff --git a/compiler/testData/cli/js/sourceMapRootManual.args b/compiler/testData/cli/js/sourceMapRootManual.args index c6f8ecc8f7b..edcf8f1684c 100644 --- a/compiler/testData/cli/js/sourceMapRootManual.args +++ b/compiler/testData/cli/js/sourceMapRootManual.args @@ -1,9 +1,19 @@ $TESTDATA_DIR$/sourceMapRoot/foo/file1.kt $TESTDATA_DIR$/sourceMapRoot/bar/file2.kt +-Xir-produce-klib-dir +-Xir-only +-libraries +$STDLIB_JS$ +-ir-output-dir +$TEMP_DIR$/klib +-ir-output-name +out +--- -Xir-produce-js -Xir-only -libraries $STDLIB_JS$ +-Xinclude=$TEMP_DIR$/klib -source-map -source-map-base-dirs $TESTDATA_DIR$/ diff --git a/compiler/testData/cli/js/sourceMapRootMissing.args b/compiler/testData/cli/js/sourceMapRootMissing.args index 5c3dee330bf..dcae3a46662 100644 --- a/compiler/testData/cli/js/sourceMapRootMissing.args +++ b/compiler/testData/cli/js/sourceMapRootMissing.args @@ -2,10 +2,20 @@ $TESTDATA_DIR$/sourceMapRoot/foo/file1.kt $TESTDATA_DIR$/sourceMapRoot/bar/file2.kt $TESTDATA_DIR$/sourceMapRoot/bar/baz/file3.kt $TESTDATA_DIR$/sourceMapRoot/foo/baz/file4.kt +-Xir-produce-klib-dir +-Xir-only +-libraries +$STDLIB_JS$ +-ir-output-dir +$TEMP_DIR$/klib +-ir-output-name +out +--- -Xir-produce-js -Xir-only -libraries $STDLIB_JS$ +-Xinclude=$TEMP_DIR$/klib -source-map -source-map-base-dirs $TESTDATA_DIR$/sourceMapRoot/foo @@ -14,3 +24,4 @@ $TEMP_DIR$ -ir-output-name out + diff --git a/compiler/testData/cli/js/sourceMapRootMultiple.args b/compiler/testData/cli/js/sourceMapRootMultiple.args index 1235e383f7b..3715701eb28 100644 --- a/compiler/testData/cli/js/sourceMapRootMultiple.args +++ b/compiler/testData/cli/js/sourceMapRootMultiple.args @@ -1,9 +1,19 @@ $TESTDATA_DIR$/sourceMapRoot/foo/file1.kt $TESTDATA_DIR$/sourceMapRoot/bar/file2.kt +-Xir-produce-klib-dir +-Xir-only +-libraries +$STDLIB_JS$ +-ir-output-dir +$TEMP_DIR$/klib +-ir-output-name +out +--- -Xir-produce-js -Xir-only -libraries $STDLIB_JS$ +-Xinclude=$TEMP_DIR$/klib -source-map -source-map-base-dirs $TESTDATA_DIR$/foo:$TESTDATA_DIR$/bar diff --git a/compiler/testData/cli/js/wrongAbiVersion.args b/compiler/testData/cli/js/wrongAbiVersion.args deleted file mode 100644 index 6f9e7ed80a6..00000000000 --- a/compiler/testData/cli/js/wrongAbiVersion.args +++ /dev/null @@ -1,7 +0,0 @@ -$TESTDATA_DIR$/simple2js.kt --Xforce-deprecated-legacy-compiler-usage --no-stdlib --libraries -$TESTDATA_DIR$/wrongAbiVersionLib/wrongAbiLib.meta.js --output -$TEMP_DIR$/out.js diff --git a/compiler/testData/cli/js/wrongAbiVersion.out b/compiler/testData/cli/js/wrongAbiVersion.out deleted file mode 100644 index 963fa870506..00000000000 --- a/compiler/testData/cli/js/wrongAbiVersion.out +++ /dev/null @@ -1,2 +0,0 @@ -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/js/wrongAbiVersion.test b/compiler/testData/cli/js/wrongAbiVersion.test deleted file mode 100644 index 8c8bba65ee6..00000000000 --- a/compiler/testData/cli/js/wrongAbiVersion.test +++ /dev/null @@ -1 +0,0 @@ -// ABSENT: out.js diff --git a/compiler/testData/cli/js/wrongAbiVersionLib/wrongAbiLib.meta.js b/compiler/testData/cli/js/wrongAbiVersionLib/wrongAbiLib.meta.js deleted file mode 100644 index c0422c16041..00000000000 --- a/compiler/testData/cli/js/wrongAbiVersionLib/wrongAbiLib.meta.js +++ /dev/null @@ -1 +0,0 @@ -// Kotlin.kotlin_module_metadata(0, "wrongAbiLib", ""); 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 3bbe8075344..337c9c32923 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/cli/AbstractCliTest.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/cli/AbstractCliTest.java @@ -70,6 +70,8 @@ public abstract class AbstractCliTest extends TestCaseWithTmpdir { int next = args.subList(index, args.size()).indexOf("---"); if (next == -1) { next = args.size(); + } else { + next = index + next; } Pair pair = CompilerTestUtil.executeCompiler(compiler, args.subList(index, next)); output.append(pair.getFirst()); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java index b5baec70979..2833be66f95 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java @@ -1358,11 +1358,6 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/js/jsHelp.args"); } - @TestMetadata("kotlinHomeWithoutStdlib.args") - public void testKotlinHomeWithoutStdlib() throws Exception { - runTest("compiler/testData/cli/js/kotlinHomeWithoutStdlib.args"); - } - @TestMetadata("kotlinPackage.args") public void testKotlinPackage() throws Exception { runTest("compiler/testData/cli/js/kotlinPackage.args"); @@ -1373,11 +1368,6 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/js/languageVersion.args"); } - @TestMetadata("legacyCompilerUsageWithoutFlag.args") - public void testLegacyCompilerUsageWithoutFlag() throws Exception { - runTest("compiler/testData/cli/js/legacyCompilerUsageWithoutFlag.args"); - } - @TestMetadata("libraryDirNotFound.args") public void testLibraryDirNotFound() throws Exception { runTest("compiler/testData/cli/js/libraryDirNotFound.args"); @@ -1448,11 +1438,6 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/js/sourceMapRelativeRoot.args"); } - @TestMetadata("sourceMapRootAuto.args") - public void testSourceMapRootAuto() throws Exception { - runTest("compiler/testData/cli/js/sourceMapRootAuto.args"); - } - @TestMetadata("sourceMapRootManual.args") public void testSourceMapRootManual() throws Exception { runTest("compiler/testData/cli/js/sourceMapRootManual.args"); @@ -1487,11 +1472,6 @@ public class CliTestGenerated extends AbstractCliTest { public void testWithLib() throws Exception { runTest("compiler/testData/cli/js/withLib.args"); } - - @TestMetadata("wrongAbiVersion.args") - public void testWrongAbiVersion() throws Exception { - runTest("compiler/testData/cli/js/wrongAbiVersion.args"); - } } @TestMetadata("compiler/testData/cli/js-dce")