diff --git a/compiler/ir/serialization.js/src/org/jetbrains/kotlin/ir/backend/js/klib.kt b/compiler/ir/serialization.js/src/org/jetbrains/kotlin/ir/backend/js/klib.kt index 1b6e2d0175c..2175ca63fe1 100644 --- a/compiler/ir/serialization.js/src/org/jetbrains/kotlin/ir/backend/js/klib.kt +++ b/compiler/ir/serialization.js/src/org/jetbrains/kotlin/ir/backend/js/klib.kt @@ -111,7 +111,7 @@ val CompilerConfiguration.resolverLogger: Logger override fun fatal(message: String): Nothing { messageLogger.report(IrMessageLogger.Severity.ERROR, message, null) - kotlin.error("FATAL ERROR: $message") + throw CompilationErrorException() } } } diff --git a/compiler/testData/cli/js/createMetadata.args b/compiler/testData/cli/js/createMetadata.args index 0ff1318ca8c..3ad1e6917a8 100644 --- a/compiler/testData/cli/js/createMetadata.args +++ b/compiler/testData/cli/js/createMetadata.args @@ -1,5 +1,9 @@ compiler/testData/integration/ant/js/simpleWithoutStdlibAndFolderAsAnotherLib/jslib-example/LibraryExample.kt --Xforce-deprecated-legacy-compiler-usage --meta-info --output -$TEMP_DIR$/jslib-example.js +-Xir-produce-klib-dir +-Xir-only +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +jslib-example +-libraries +$STDLIB_JS$ \ No newline at end of file diff --git a/compiler/testData/cli/js/createMetadata.test b/compiler/testData/cli/js/createMetadata.test index f2ef15728f1..ab6a6915d81 100644 --- a/compiler/testData/cli/js/createMetadata.test +++ b/compiler/testData/cli/js/createMetadata.test @@ -1,3 +1 @@ -// EXISTS: jslib-example.meta.js -// EXISTS: jslib-example.js -// EXISTS: jslib-example/library/sample/sample.kjsm +// EXISTS: default/manifest \ No newline at end of file diff --git a/compiler/testData/cli/js/folderAsLib/LibraryExample.js b/compiler/testData/cli/js/folderAsLib/LibraryExample.js deleted file mode 100644 index 68154be1e35..00000000000 --- a/compiler/testData/cli/js/folderAsLib/LibraryExample.js +++ /dev/null @@ -1,44 +0,0 @@ -if (typeof kotlin === 'undefined') { - throw new Error("Error loading module 'LibraryExample'. Its dependency 'kotlin' was not found. Please, check whether 'kotlin' is loaded prior to 'LibraryExample'."); -} -var LibraryExample = function (_, Kotlin) { - 'use strict'; - function pairAdd(p) { - return p.first + p.second | 0; - } - function pairMul(p) { - return Kotlin.imul(p.first, p.second); - } - function IntHolder(value) { - this.value = value; - } - IntHolder.$metadata$ = { - kind: Kotlin.Kind.CLASS, - simpleName: 'IntHolder', - interfaces: [] - }; - IntHolder.prototype.component1 = function () { - return this.value; - }; - IntHolder.prototype.copy_za3lpa$ = function (value) { - return new IntHolder(value === void 0 ? this.value : value); - }; - IntHolder.prototype.toString = function () { - return 'IntHolder(value=' + Kotlin.toString(this.value) + ')'; - }; - IntHolder.prototype.hashCode = function () { - var result = 0; - result = result * 31 + Kotlin.hashCode(this.value) | 0; - return result; - }; - IntHolder.prototype.equals = function (other) { - return this === other || (other !== null && (typeof other === 'object' && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && Kotlin.equals(this.value, other.value)))); - }; - var package$library = _.library || (_.library = {}); - var package$sample = package$library.sample || (package$library.sample = {}); - package$sample.pairAdd_1fzo63$ = pairAdd; - package$sample.pairMul_1fzo63$ = pairMul; - package$sample.IntHolder = IntHolder; - Kotlin.defineModule('LibraryExample', _); - return _; -}(typeof LibraryExample === 'undefined' ? {} : LibraryExample, kotlin); diff --git a/compiler/testData/cli/js/folderAsLib/LibraryExample.meta.js b/compiler/testData/cli/js/folderAsLib/LibraryExample.meta.js deleted file mode 100644 index 5dd2ffc566e..00000000000 --- a/compiler/testData/cli/js/folderAsLib/LibraryExample.meta.js +++ /dev/null @@ -1 +0,0 @@ -// Kotlin.kotlin_module_metadata(1, "LibraryExample", "H4sIAAAAAAAAAJVW227TQBB1fF1Pb64LJTUgRBEgbiWkCIEESC19KJWQgIoPcJ1tsqmzG9ZO0v4Ar0h9QP2UfAGf0N+BcS5O0tRu6gfvaHdmzlzOjq2490FxFa94Rv4Nn0LXHsmnRHE9sMD49oOz2NVBdRTPPCNK11aSs4cwD+aRiEPGQWXChUQBdKI4hUQNffVcvIabqZol6WFIgxjUeuQ6I318Fxw1sVK7tjp0rtf9tg96K2ZhlvOXsJo6n6fHTSpZg/LYzzToBV3/2aLyBNQWy1J7BzdAE7IKWmczAK0iGqAFUeSuXowZ36qjJaZa19YS0yfgpCGZ0udVGmWh7MNGqgqBkAJT5TSazASA8VgyHrFgJvwNWBoP/bgm8yv9CBbSIJJEr1OSlgxnCakIRs90mkO3gQzbMX34AGCEmBXWxhi95gLRaPqSRYJn1vw5rKT6dkQRmgfZHXqBSacdakqBbYlZtvqFYMKE6ywnmAn3IwLkXaVeQayjmhRcRGB06EE1zG/wZY2L2tVZGvcebl00NWkbaTkTEycGRD0zqx4H+mrTHNgcq1AP3zhosbCSn/FTWJ4aOVnobyZSnMMGHwrZ8JEU+RjPwE0xCN5QKnn21NmC9asvej7ebw3+FMAK2YH0cXaZkd9ohhTszzzeFWGFylGZtvgJGG0/bFHQ8DhBbDQFR5BXoAeiidbIez+MwNoWIqQ+B0PENXRBan5U+yQqFEgs9pOpUwVzsFpNn8mtSgUKTdC/otzf+dIK3Y9jgZtJ4EUFdzSUNUdHOVnNwQqDdXGwLhcVb8e76yx5askou47jLbq6i3L/XSJdouCxm3Pcr/M6I79IUS2rJX2buKZjJBZ7tmMl6+5fbW/FISiqZYI8NfqbBdy0UTTLxJnz9GKhpO+ea2g03zs/L6C4gKKF4veBSwQ8JSpMDdpkdM7OygMpOhGVWYR5C2tjvhe4iNkhC/z+MMlFKSHKyNI4pHFQy7d4DIuTUyUrqERxmIAe0+PMOzXxSam3Mz8pd8BOGT199T9A8eLwQcbJCMk4y/Qp46AfmVsdIY+ovGbxWEivsFgDs/+fMh3/Dty79MdnbFzMkMbEJ8LnyIQeCzJK6g1U/wOSAB0W3QkAAA=="); diff --git a/compiler/testData/cli/js/folderAsLib/LibraryExample/library/sample/sample.kjsm b/compiler/testData/cli/js/folderAsLib/LibraryExample/library/sample/sample.kjsm deleted file mode 100644 index f53578c8ac0..00000000000 Binary files a/compiler/testData/cli/js/folderAsLib/LibraryExample/library/sample/sample.kjsm and /dev/null differ diff --git a/compiler/testData/cli/js/folderAsLib/default/ir/bodies.knb b/compiler/testData/cli/js/folderAsLib/default/ir/bodies.knb new file mode 100644 index 00000000000..0a81e515810 Binary files /dev/null and b/compiler/testData/cli/js/folderAsLib/default/ir/bodies.knb differ diff --git a/compiler/testData/cli/js/folderAsLib/default/ir/debugInfo.knd b/compiler/testData/cli/js/folderAsLib/default/ir/debugInfo.knd new file mode 100644 index 00000000000..1fbc5685498 Binary files /dev/null and b/compiler/testData/cli/js/folderAsLib/default/ir/debugInfo.knd differ diff --git a/compiler/testData/cli/js/folderAsLib/default/ir/files.knf b/compiler/testData/cli/js/folderAsLib/default/ir/files.knf new file mode 100644 index 00000000000..e5ae5257418 Binary files /dev/null and b/compiler/testData/cli/js/folderAsLib/default/ir/files.knf differ diff --git a/compiler/testData/cli/js/folderAsLib/default/ir/irDeclarations.knd b/compiler/testData/cli/js/folderAsLib/default/ir/irDeclarations.knd new file mode 100644 index 00000000000..a48b88ee10a Binary files /dev/null and b/compiler/testData/cli/js/folderAsLib/default/ir/irDeclarations.knd differ diff --git a/compiler/testData/cli/js/folderAsLib/default/ir/signatures.knt b/compiler/testData/cli/js/folderAsLib/default/ir/signatures.knt new file mode 100644 index 00000000000..02f9413ed20 Binary files /dev/null and b/compiler/testData/cli/js/folderAsLib/default/ir/signatures.knt differ diff --git a/compiler/testData/cli/js/folderAsLib/default/ir/strings.knt b/compiler/testData/cli/js/folderAsLib/default/ir/strings.knt new file mode 100644 index 00000000000..af152b59a7b Binary files /dev/null and b/compiler/testData/cli/js/folderAsLib/default/ir/strings.knt differ diff --git a/compiler/testData/cli/js/folderAsLib/default/ir/types.knt b/compiler/testData/cli/js/folderAsLib/default/ir/types.knt new file mode 100644 index 00000000000..2fe2519b753 Binary files /dev/null and b/compiler/testData/cli/js/folderAsLib/default/ir/types.knt differ diff --git a/compiler/testData/cli/js/folderAsLib/default/linkdata/module b/compiler/testData/cli/js/folderAsLib/default/linkdata/module new file mode 100644 index 00000000000..9481cde84c3 --- /dev/null +++ b/compiler/testData/cli/js/folderAsLib/default/linkdata/module @@ -0,0 +1,2 @@ + +:library.sample \ No newline at end of file diff --git a/compiler/testData/cli/js/folderAsLib/default/linkdata/package_library.sample/0_sample.knm b/compiler/testData/cli/js/folderAsLib/default/linkdata/package_library.sample/0_sample.knm new file mode 100644 index 00000000000..4b9f353d2da Binary files /dev/null and b/compiler/testData/cli/js/folderAsLib/default/linkdata/package_library.sample/0_sample.knm differ diff --git a/compiler/testData/cli/js/folderAsLib/default/manifest b/compiler/testData/cli/js/folderAsLib/default/manifest new file mode 100644 index 00000000000..83b51236624 --- /dev/null +++ b/compiler/testData/cli/js/folderAsLib/default/manifest @@ -0,0 +1,8 @@ +abi_version=1.8.0 +builtins_platform=JS +compiler_version=1.9.255-SNAPSHOT +depends=kotlin +metadata_version=1.4.1 +serializedIrFileFingerprints=3vriludieft1x.1583499ndbss7 +serializedKlibFingerprint=3f3efqjuxw1sw.xi1rrqn6iire +unique_name=LibraryExample diff --git a/compiler/testData/cli/js/inlineCycle.args b/compiler/testData/cli/js/inlineCycle.args deleted file mode 100644 index a257d8f8a2b..00000000000 --- a/compiler/testData/cli/js/inlineCycle.args +++ /dev/null @@ -1,4 +0,0 @@ -$TESTDATA_DIR$/inlineCycle.kt --Xforce-deprecated-legacy-compiler-usage --output -$TEMP_DIR$ diff --git a/compiler/testData/cli/js/inlineCycle.kt b/compiler/testData/cli/js/inlineCycle.kt deleted file mode 100644 index 09fc245f430..00000000000 --- a/compiler/testData/cli/js/inlineCycle.kt +++ /dev/null @@ -1,20 +0,0 @@ -inline fun a(l: () -> Unit) { - b(l) - - //check that nested not recognized as cycle - c { - c { - - } - } -} - - -inline fun b(p: () -> Unit) { - p() - a(p) -} - -inline fun c(p: () -> Unit) { - p() -} \ No newline at end of file diff --git a/compiler/testData/cli/js/inlineCycle.out b/compiler/testData/cli/js/inlineCycle.out deleted file mode 100644 index f0b7956570f..00000000000 --- a/compiler/testData/cli/js/inlineCycle.out +++ /dev/null @@ -1,7 +0,0 @@ -compiler/testData/cli/js/inlineCycle.kt:2:5: error: the 'b' invocation is a part of inline cycle - b(l) - ^ -compiler/testData/cli/js/inlineCycle.kt:15:5: error: the 'a' invocation is a part of inline cycle - a(p) - ^ -COMPILATION_ERROR diff --git a/compiler/testData/cli/js/languageVersion.args b/compiler/testData/cli/js/languageVersion.args index 952a7d4927c..d3887d33689 100644 --- a/compiler/testData/cli/js/languageVersion.args +++ b/compiler/testData/cli/js/languageVersion.args @@ -1,6 +1,11 @@ $TESTDATA_DIR$/languageVersion.kt --Xforce-deprecated-legacy-compiler-usage --output -$TEMP_DIR$/out.js +-Xir-produce-klib-dir +-Xir-only +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out -language-version 1.4 +-libraries +$STDLIB_JS$ diff --git a/compiler/testData/cli/js/lib/LibraryExample.jar b/compiler/testData/cli/js/lib/LibraryExample.jar deleted file mode 100644 index 8f4c227bcb9..00000000000 Binary files a/compiler/testData/cli/js/lib/LibraryExample.jar and /dev/null differ diff --git a/compiler/testData/cli/js/lib/LibraryExample.klib b/compiler/testData/cli/js/lib/LibraryExample.klib new file mode 100644 index 00000000000..fedbeb4bb8e Binary files /dev/null and b/compiler/testData/cli/js/lib/LibraryExample.klib differ diff --git a/compiler/testData/cli/js/lib/ReadMe.md b/compiler/testData/cli/js/lib/ReadMe.md index b419e48b014..42c46cd0bed 100644 --- a/compiler/testData/cli/js/lib/ReadMe.md +++ b/compiler/testData/cli/js/lib/ReadMe.md @@ -1,5 +1,5 @@ # jslib -Path to sources: `compiler/testData/cli/js/jslib` +Path to sources: `compiler/testData/cli/js/lib` `folderAsLib/LibraryExample.js`, `folderAsLib/LibraryExample.meta.js` and `LibraryExample.jar` should be updated after changing some files in source folder. \ No newline at end of file diff --git a/compiler/testData/cli/js/libraryDirNotFound.args b/compiler/testData/cli/js/libraryDirNotFound.args index 9c78073345c..bdd503368a7 100644 --- a/compiler/testData/cli/js/libraryDirNotFound.args +++ b/compiler/testData/cli/js/libraryDirNotFound.args @@ -1,6 +1,9 @@ $TESTDATA_DIR$/withLib.kt --Xforce-deprecated-legacy-compiler-usage +-Xir-produce-klib-dir +-Xir-only -libraries -not/existing/path --output -$TEMP_DIR$/out.js +$STDLIB_JS$:not/existing/path +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out diff --git a/compiler/testData/cli/js/libraryDirNotFound.out b/compiler/testData/cli/js/libraryDirNotFound.out index 3f4e3e154fc..36b11e5f7ec 100644 --- a/compiler/testData/cli/js/libraryDirNotFound.out +++ b/compiler/testData/cli/js/libraryDirNotFound.out @@ -1,2 +1,2 @@ -error: path 'not/existing/path' does not exist +error: could not find "not/existing/path" in [$USER_DIR$] COMPILATION_ERROR diff --git a/compiler/testData/cli/js/moduleWithMetadataOnlyDependency.args b/compiler/testData/cli/js/moduleWithMetadataOnlyDependency.args deleted file mode 100644 index 093152029ec..00000000000 --- a/compiler/testData/cli/js/moduleWithMetadataOnlyDependency.args +++ /dev/null @@ -1,13 +0,0 @@ -$TESTDATA_DIR$/separateModules/sepModule1.kt --Xforce-deprecated-legacy-compiler-usage --meta-info --Xmetadata-only --output -$TEMP_DIR$/m1/m1.js ---- -$TESTDATA_DIR$/separateModules/sepModule2.kt --Xforce-deprecated-legacy-compiler-usage --libraries -$TEMP_DIR$/m1 --output -$TEMP_DIR$/m2/m2.js \ No newline at end of file diff --git a/compiler/testData/cli/js/moduleWithMetadataOnlyDependency.out b/compiler/testData/cli/js/moduleWithMetadataOnlyDependency.out deleted file mode 100644 index d86bac9de59..00000000000 --- a/compiler/testData/cli/js/moduleWithMetadataOnlyDependency.out +++ /dev/null @@ -1 +0,0 @@ -OK diff --git a/compiler/testData/cli/js/moduleWithMetadataOnlyDependency.test b/compiler/testData/cli/js/moduleWithMetadataOnlyDependency.test deleted file mode 100644 index cafe8620ea5..00000000000 --- a/compiler/testData/cli/js/moduleWithMetadataOnlyDependency.test +++ /dev/null @@ -1,5 +0,0 @@ -// EXISTS: m1/m1.meta.js -// ABSENT: m1/m1.js -// EXISTS: m1/m1/m1/m1.kjsm - -// EXISTS: m2/m2.js \ No newline at end of file diff --git a/compiler/testData/cli/js/modulesWithSameNames.args b/compiler/testData/cli/js/modulesWithSameNames.args deleted file mode 100644 index 35cf4831c08..00000000000 --- a/compiler/testData/cli/js/modulesWithSameNames.args +++ /dev/null @@ -1,12 +0,0 @@ -$TESTDATA_DIR$/separateModules/sepModule1.kt --Xforce-deprecated-legacy-compiler-usage --meta-info --output -$TEMP_DIR$/m1/m.js ---- -$TESTDATA_DIR$/separateModules/sepModule2.kt --Xforce-deprecated-legacy-compiler-usage --libraries -$TEMP_DIR$/m1 --output -$TEMP_DIR$/m2/m.js \ No newline at end of file diff --git a/compiler/testData/cli/js/modulesWithSameNames.out b/compiler/testData/cli/js/modulesWithSameNames.out deleted file mode 100644 index 7dbb3f33ebf..00000000000 --- a/compiler/testData/cli/js/modulesWithSameNames.out +++ /dev/null @@ -1,2 +0,0 @@ -warning: module "m" depends on module with the same name -OK \ No newline at end of file diff --git a/compiler/testData/cli/js/modulesWithSameNames.test b/compiler/testData/cli/js/modulesWithSameNames.test deleted file mode 100644 index 2f49dae589c..00000000000 --- a/compiler/testData/cli/js/modulesWithSameNames.test +++ /dev/null @@ -1 +0,0 @@ -// NOT_CONTAINS: m2/m.js, foo(bar$lambda); \ No newline at end of file diff --git a/compiler/testData/cli/js/modulesWithSameNamesAndFunc.args b/compiler/testData/cli/js/modulesWithSameNamesAndFunc.args deleted file mode 100644 index 7dc5ce5c209..00000000000 --- a/compiler/testData/cli/js/modulesWithSameNamesAndFunc.args +++ /dev/null @@ -1,12 +0,0 @@ -$TESTDATA_DIR$/separateModules/sepModule3.kt --Xforce-deprecated-legacy-compiler-usage --meta-info --output -$TEMP_DIR$/m3/m.js ---- -$TESTDATA_DIR$/separateModules/sepModule4.kt --Xforce-deprecated-legacy-compiler-usage --libraries -$TEMP_DIR$/m3 --output -$TEMP_DIR$/m4/m.js \ No newline at end of file diff --git a/compiler/testData/cli/js/modulesWithSameNamesAndFunc.out b/compiler/testData/cli/js/modulesWithSameNamesAndFunc.out deleted file mode 100644 index 7dbb3f33ebf..00000000000 --- a/compiler/testData/cli/js/modulesWithSameNamesAndFunc.out +++ /dev/null @@ -1,2 +0,0 @@ -warning: module "m" depends on module with the same name -OK \ No newline at end of file diff --git a/compiler/testData/cli/js/modulesWithSameNamesAndFunc.test b/compiler/testData/cli/js/modulesWithSameNamesAndFunc.test deleted file mode 100644 index 04e189486b6..00000000000 --- a/compiler/testData/cli/js/modulesWithSameNamesAndFunc.test +++ /dev/null @@ -1 +0,0 @@ -// NOT_CONTAINS: m4/m.js, foofaa(); \ No newline at end of file diff --git a/compiler/testData/cli/js/notValidLibraryDir.args b/compiler/testData/cli/js/notValidLibraryDir.args index bf09f1c03b1..23836c19e49 100644 --- a/compiler/testData/cli/js/notValidLibraryDir.args +++ b/compiler/testData/cli/js/notValidLibraryDir.args @@ -1,6 +1,9 @@ $TESTDATA_DIR$/withLib.kt --Xforce-deprecated-legacy-compiler-usage +-Xir-produce-klib-dir +-Xir-only -libraries -compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLib --output -$TEMP_DIR$/out.js +$STDLIB_JS$:compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLib +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out diff --git a/compiler/testData/cli/js/notValidLibraryDir.out b/compiler/testData/cli/js/notValidLibraryDir.out index 82ff68be02e..bc9c7acc419 100644 --- a/compiler/testData/cli/js/notValidLibraryDir.out +++ b/compiler/testData/cli/js/notValidLibraryDir.out @@ -1,8 +1,2 @@ -warning: 'compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLib' is not a valid Kotlin Javascript library -compiler/testData/cli/js/withLib.kt:2:8: error: unresolved reference: library -import library.sample.* - ^ -compiler/testData/cli/js/withLib.kt:6:13: error: unresolved reference: pairAdd - val x = pairAdd(p) - ^ +error: could not find "compiler/testData/integration/ant/js/simpleWithJsFileAsAnotherLib" in [$USER_DIR$] COMPILATION_ERROR diff --git a/compiler/testData/cli/js/outputIsDirectory.args b/compiler/testData/cli/js/outputIsDirectory.args deleted file mode 100644 index 8c5df02ff33..00000000000 --- a/compiler/testData/cli/js/outputIsDirectory.args +++ /dev/null @@ -1,4 +0,0 @@ -$TESTDATA_DIR$/simple2js.kt --Xforce-deprecated-legacy-compiler-usage --output -$TESTDATA_DIR$ diff --git a/compiler/testData/cli/js/outputIsDirectory.out b/compiler/testData/cli/js/outputIsDirectory.out deleted file mode 100644 index e08cc42ef6f..00000000000 --- a/compiler/testData/cli/js/outputIsDirectory.out +++ /dev/null @@ -1,2 +0,0 @@ -error: cannot open output file '$TESTDATA_DIR$': is a directory -COMPILATION_ERROR diff --git a/compiler/testData/cli/js/outputIsDirectory.test b/compiler/testData/cli/js/outputIsDirectory.test deleted file mode 100644 index 8c8bba65ee6..00000000000 --- a/compiler/testData/cli/js/outputIsDirectory.test +++ /dev/null @@ -1 +0,0 @@ -// ABSENT: out.js diff --git a/compiler/testData/cli/js/outputPostfixFileNotFound.args b/compiler/testData/cli/js/outputPostfixFileNotFound.args deleted file mode 100644 index 5b2eb1dbd24..00000000000 --- a/compiler/testData/cli/js/outputPostfixFileNotFound.args +++ /dev/null @@ -1,6 +0,0 @@ -$TESTDATA_DIR$/simple2js.kt --Xforce-deprecated-legacy-compiler-usage --output -$TEMP_DIR$/out.js --output-postfix -not/existing/path diff --git a/compiler/testData/cli/js/outputPostfixFileNotFound.out b/compiler/testData/cli/js/outputPostfixFileNotFound.out deleted file mode 100644 index 414fd079cba..00000000000 --- a/compiler/testData/cli/js/outputPostfixFileNotFound.out +++ /dev/null @@ -1,2 +0,0 @@ -error: output postfix file 'not/existing/path' not found -COMPILATION_ERROR diff --git a/compiler/testData/cli/js/outputPostfixFileNotFound.test b/compiler/testData/cli/js/outputPostfixFileNotFound.test deleted file mode 100644 index 8c8bba65ee6..00000000000 --- a/compiler/testData/cli/js/outputPostfixFileNotFound.test +++ /dev/null @@ -1 +0,0 @@ -// ABSENT: out.js diff --git a/compiler/testData/cli/js/outputPrefixFileNotFound.args b/compiler/testData/cli/js/outputPrefixFileNotFound.args deleted file mode 100644 index 50e437dd1b4..00000000000 --- a/compiler/testData/cli/js/outputPrefixFileNotFound.args +++ /dev/null @@ -1,6 +0,0 @@ -$TESTDATA_DIR$/simple2js.kt --Xforce-deprecated-legacy-compiler-usage --output -$TEMP_DIR$/out.js --output-prefix -not/existing/path diff --git a/compiler/testData/cli/js/outputPrefixFileNotFound.out b/compiler/testData/cli/js/outputPrefixFileNotFound.out deleted file mode 100644 index ff4ddabc7b3..00000000000 --- a/compiler/testData/cli/js/outputPrefixFileNotFound.out +++ /dev/null @@ -1,2 +0,0 @@ -error: output prefix file 'not/existing/path' not found -COMPILATION_ERROR diff --git a/compiler/testData/cli/js/outputPrefixFileNotFound.test b/compiler/testData/cli/js/outputPrefixFileNotFound.test deleted file mode 100644 index 8c8bba65ee6..00000000000 --- a/compiler/testData/cli/js/outputPrefixFileNotFound.test +++ /dev/null @@ -1 +0,0 @@ -// ABSENT: out.js diff --git a/compiler/testData/cli/js/reifiedIntersectionType.args b/compiler/testData/cli/js/reifiedIntersectionType.args index 8c8f871fd96..753dabf5b73 100644 --- a/compiler/testData/cli/js/reifiedIntersectionType.args +++ b/compiler/testData/cli/js/reifiedIntersectionType.args @@ -1,4 +1,9 @@ $TESTDATA_DIR$/reifiedIntersectionType.kt --Xforce-deprecated-legacy-compiler-usage --output -$TEMP_DIR$/out.js +-Xir-produce-klib-dir +-Xir-only +-libraries +$STDLIB_JS$ +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out diff --git a/compiler/testData/cli/js/separateModules/sepModule1.kt b/compiler/testData/cli/js/separateModules/sepModule1.kt deleted file mode 100644 index 886c695c407..00000000000 --- a/compiler/testData/cli/js/separateModules/sepModule1.kt +++ /dev/null @@ -1,6 +0,0 @@ -package m1 - -inline fun foo(action: () -> Int): Int { - return action() -} - diff --git a/compiler/testData/cli/js/separateModules/sepModule2.kt b/compiler/testData/cli/js/separateModules/sepModule2.kt deleted file mode 100644 index d1e0d9f9c42..00000000000 --- a/compiler/testData/cli/js/separateModules/sepModule2.kt +++ /dev/null @@ -1,13 +0,0 @@ -package m2 - -import m1.* - -fun bar(): Int { - foo { return 100 } - return -99 -} - -fun box(): String { - if (bar() == 100) return "OK" - return "fail" -} \ No newline at end of file diff --git a/compiler/testData/cli/js/separateModules/sepModule3.kt b/compiler/testData/cli/js/separateModules/sepModule3.kt deleted file mode 100644 index f4f303a5ebb..00000000000 --- a/compiler/testData/cli/js/separateModules/sepModule3.kt +++ /dev/null @@ -1,10 +0,0 @@ -package m3 - - -fun foofaa(): Unit { } - -inline fun foo(action: () -> Int): Int { - foofaa() - return action() -} - diff --git a/compiler/testData/cli/js/separateModules/sepModule4.kt b/compiler/testData/cli/js/separateModules/sepModule4.kt deleted file mode 100644 index 5781d2cfeb0..00000000000 --- a/compiler/testData/cli/js/separateModules/sepModule4.kt +++ /dev/null @@ -1,17 +0,0 @@ -package m4 - -import m3.* - -inline fun foo(action: () -> Int): Int { - return action() -} - -fun bar(): Int { - foo { return 100 } - return -99 -} - -fun box(): String { - if (bar() == 100) return "OK" - return "fail" -} \ No newline at end of file diff --git a/compiler/testData/cli/js/simple2js.args b/compiler/testData/cli/js/simple2js.args index e3dc179f89f..4cbeb53754a 100644 --- a/compiler/testData/cli/js/simple2js.args +++ b/compiler/testData/cli/js/simple2js.args @@ -1,4 +1,9 @@ $TESTDATA_DIR$/simple2js.kt --Xforce-deprecated-legacy-compiler-usage --output -$TEMP_DIR$/out.js +-Xir-produce-klib-dir +-Xir-only +-libraries +$STDLIB_JS$ +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out diff --git a/compiler/testData/cli/js/simple2js.test b/compiler/testData/cli/js/simple2js.test index cc68ed467c9..103cfa3c288 100644 --- a/compiler/testData/cli/js/simple2js.test +++ b/compiler/testData/cli/js/simple2js.test @@ -1 +1 @@ -// EXISTS: out.js +// EXISTS: default/manifest diff --git a/compiler/testData/cli/js/sourceMap.args b/compiler/testData/cli/js/sourceMap.args index ff6733a4b15..aa073041d2e 100644 --- a/compiler/testData/cli/js/sourceMap.args +++ b/compiler/testData/cli/js/sourceMap.args @@ -1,7 +1,12 @@ $TESTDATA_DIR$/sourceMap.kt --Xforce-deprecated-legacy-compiler-usage +-Xir-produce-js +-Xir-only +-libraries +$STDLIB_JS$ -source-map -source-map-prefix ./ --output -$TEMP_DIR$/out.js +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out diff --git a/compiler/testData/cli/js/sourceMap.out b/compiler/testData/cli/js/sourceMap.out index d86bac9de59..e4bc79944e6 100644 --- a/compiler/testData/cli/js/sourceMap.out +++ b/compiler/testData/cli/js/sourceMap.out @@ -1 +1,4 @@ +info: produce executable: $TMP_DIR$ +info: cache directory: null +info: executable production duration: [time] OK diff --git a/compiler/testData/cli/js/sourceMapCharEscape.args b/compiler/testData/cli/js/sourceMapCharEscape.args index 92787d2cdf3..291992255d1 100644 --- a/compiler/testData/cli/js/sourceMapCharEscape.args +++ b/compiler/testData/cli/js/sourceMapCharEscape.args @@ -1,7 +1,12 @@ $TESTDATA_DIR$/sourceMapCharEscape.kt --Xforce-deprecated-legacy-compiler-usage +-Xir-produce-js +-Xir-only +-libraries +$STDLIB_JS$ -source-map -source-map-embed-sources always --output -$TEMP_DIR$/out.js +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out diff --git a/compiler/testData/cli/js/sourceMapCharEscape.out b/compiler/testData/cli/js/sourceMapCharEscape.out index d86bac9de59..e4bc79944e6 100644 --- a/compiler/testData/cli/js/sourceMapCharEscape.out +++ b/compiler/testData/cli/js/sourceMapCharEscape.out @@ -1 +1,4 @@ +info: produce executable: $TMP_DIR$ +info: cache directory: null +info: executable production duration: [time] OK diff --git a/compiler/testData/cli/js/sourceMapDuplicateRelativePaths.args b/compiler/testData/cli/js/sourceMapDuplicateRelativePaths.args index ab59ae1e1bd..77625b229d2 100644 --- a/compiler/testData/cli/js/sourceMapDuplicateRelativePaths.args +++ b/compiler/testData/cli/js/sourceMapDuplicateRelativePaths.args @@ -1,7 +1,12 @@ $TESTDATA_DIR$/sourceMapDuplicatePath/ --Xforce-deprecated-legacy-compiler-usage +-Xir-produce-js +-Xir-only +-libraries +$STDLIB_JS$ -source-map -source-map-base-dirs $TESTDATA_DIR$/sourceMapDuplicatePath/foo:$TESTDATA_DIR$/sourceMapDuplicatePath/bar --output -$TEMP_DIR$/out.js +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out diff --git a/compiler/testData/cli/js/sourceMapDuplicateRelativePaths.out b/compiler/testData/cli/js/sourceMapDuplicateRelativePaths.out index a7d9bd4940f..e4bc79944e6 100644 --- a/compiler/testData/cli/js/sourceMapDuplicateRelativePaths.out +++ b/compiler/testData/cli/js/sourceMapDuplicateRelativePaths.out @@ -1,2 +1,4 @@ -warning: there are files with same path 'lib.kt', relative to source roots: '$TESTDATA_DIR$/sourceMapDuplicatePath/foo/lib.kt' and '$TESTDATA_DIR$/sourceMapDuplicatePath/bar/lib.kt'. This will likely cause problems with debugger +info: produce executable: $TMP_DIR$ +info: cache directory: null +info: executable production duration: [time] OK diff --git a/compiler/testData/cli/js/sourceMapEmbedSources.args b/compiler/testData/cli/js/sourceMapEmbedSources.args index ec2fe578094..4e9fc7cc180 100644 --- a/compiler/testData/cli/js/sourceMapEmbedSources.args +++ b/compiler/testData/cli/js/sourceMapEmbedSources.args @@ -1,9 +1,14 @@ $TESTDATA_DIR$/sourceMap.kt --Xforce-deprecated-legacy-compiler-usage +-Xir-produce-js +-Xir-only +-libraries +$STDLIB_JS$ -source-map -source-map-prefix ./ -source-map-embed-sources always --output -$TEMP_DIR$/out.js +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out diff --git a/compiler/testData/cli/js/sourceMapEmbedSources.out b/compiler/testData/cli/js/sourceMapEmbedSources.out index a0aba9318ad..15a9042e343 100644 --- a/compiler/testData/cli/js/sourceMapEmbedSources.out +++ b/compiler/testData/cli/js/sourceMapEmbedSources.out @@ -1 +1,4 @@ +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/sourceMapPrefix.args b/compiler/testData/cli/js/sourceMapPrefix.args index 22a548a7717..fc518e49aec 100644 --- a/compiler/testData/cli/js/sourceMapPrefix.args +++ b/compiler/testData/cli/js/sourceMapPrefix.args @@ -1,7 +1,12 @@ $TESTDATA_DIR$/sourceMap.kt --Xforce-deprecated-legacy-compiler-usage +-Xir-produce-js +-Xir-only +-libraries +$STDLIB_JS$ -source-map -source-map-prefix /localhost/src/ --output -$TEMP_DIR$/out.js +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out diff --git a/compiler/testData/cli/js/sourceMapPrefix.out b/compiler/testData/cli/js/sourceMapPrefix.out index d86bac9de59..e4bc79944e6 100644 --- a/compiler/testData/cli/js/sourceMapPrefix.out +++ b/compiler/testData/cli/js/sourceMapPrefix.out @@ -1 +1,4 @@ +info: produce executable: $TMP_DIR$ +info: cache directory: null +info: executable production duration: [time] OK diff --git a/compiler/testData/cli/js/sourceMapRelativeRoot.args b/compiler/testData/cli/js/sourceMapRelativeRoot.args index f1c35306b09..e1557415c22 100644 --- a/compiler/testData/cli/js/sourceMapRelativeRoot.args +++ b/compiler/testData/cli/js/sourceMapRelativeRoot.args @@ -1,14 +1,21 @@ $TESTDATA_DIR$/sourceMapRelativeRoot/lib/src/lib.kt --Xforce-deprecated-legacy-compiler-usage +-Xir-produce-klib-dir +-Xir-only +-libraries +$STDLIB_JS$ -source-map --meta-info --output -$TESTDATA_DIR$/sourceMapRelativeRoot/lib/out/lib.js +-ir-output-dir +$TESTDATA_DIR$/sourceMapRelativeRoot/lib/out +-ir-output-name +lib --- $TESTDATA_DIR$/sourceMapRelativeRoot/main/src/main.kt --Xforce-deprecated-legacy-compiler-usage +-Xir-produce-js +-Xir-only -libraries -$TESTDATA_DIR$/sourceMapRelativeRoot/lib/out/ +$STDLIB_JS$:$TESTDATA_DIR$/sourceMapRelativeRoot/lib/out/ -source-map --output -$TESTDATA_DIR$/sourceMapRelativeRoot/main/out/main.js +-ir-output-dir +$TESTDATA_DIR$/sourceMapRelativeRoot/main/out +-ir-output-name +main diff --git a/compiler/testData/cli/js/sourceMapRelativeRoot.out b/compiler/testData/cli/js/sourceMapRelativeRoot.out index d86bac9de59..37986f887ac 100644 --- a/compiler/testData/cli/js/sourceMapRelativeRoot.out +++ b/compiler/testData/cli/js/sourceMapRelativeRoot.out @@ -1 +1,4 @@ +info: produce executable: $TESTDATA_DIR$/sourceMapRelativeRoot/main/out +info: cache directory: null +info: executable production duration: [time] OK diff --git a/compiler/testData/cli/js/sourceMapRelativeRoot.test b/compiler/testData/cli/js/sourceMapRelativeRoot.test index e7fd01e82f1..862820e1522 100644 --- a/compiler/testData/cli/js/sourceMapRelativeRoot.test +++ b/compiler/testData/cli/js/sourceMapRelativeRoot.test @@ -1,5 +1,3 @@ -// EXISTS: $TESTDATA_DIR$/sourceMapRelativeRoot/lib/out/lib.js // EXISTS: $TESTDATA_DIR$/sourceMapRelativeRoot/main/out/main.js -// CONTAINS: $TESTDATA_DIR$/sourceMapRelativeRoot/lib/out/lib.js.map, "../src/lib.kt" // CONTAINS: $TESTDATA_DIR$/sourceMapRelativeRoot/main/out/main.js.map, "../src/main.kt" // CONTAINS: $TESTDATA_DIR$/sourceMapRelativeRoot/main/out/main.js.map, "../../lib/src/lib.kt" diff --git a/compiler/testData/cli/js/sourceMapRootAuto.args b/compiler/testData/cli/js/sourceMapRootAuto.args index 2ef71242189..8d6f8578120 100644 --- a/compiler/testData/cli/js/sourceMapRootAuto.args +++ b/compiler/testData/cli/js/sourceMapRootAuto.args @@ -1,8 +1,13 @@ $TESTDATA_DIR$/sourceMapRoot/foo/file1.kt $TESTDATA_DIR$/sourceMapRoot/bar/file2.kt --Xforce-deprecated-legacy-compiler-usage +-Xir-produce-js +-Xir-only +-libraries +$STDLIB_JS$ -source-map -source-map-prefix ./ --output -$TEMP_DIR$/out.js +-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 index a0aba9318ad..15a9042e343 100644 --- a/compiler/testData/cli/js/sourceMapRootAuto.out +++ b/compiler/testData/cli/js/sourceMapRootAuto.out @@ -1 +1,4 @@ +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/sourceMapRootManual.args b/compiler/testData/cli/js/sourceMapRootManual.args index e30a49abca3..c6f8ecc8f7b 100644 --- a/compiler/testData/cli/js/sourceMapRootManual.args +++ b/compiler/testData/cli/js/sourceMapRootManual.args @@ -1,8 +1,13 @@ $TESTDATA_DIR$/sourceMapRoot/foo/file1.kt $TESTDATA_DIR$/sourceMapRoot/bar/file2.kt --Xforce-deprecated-legacy-compiler-usage +-Xir-produce-js +-Xir-only +-libraries +$STDLIB_JS$ -source-map -source-map-base-dirs $TESTDATA_DIR$/ --output -$TEMP_DIR$/out.js +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out diff --git a/compiler/testData/cli/js/sourceMapRootManual.out b/compiler/testData/cli/js/sourceMapRootManual.out index a0aba9318ad..15a9042e343 100644 --- a/compiler/testData/cli/js/sourceMapRootManual.out +++ b/compiler/testData/cli/js/sourceMapRootManual.out @@ -1 +1,4 @@ +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/sourceMapRootMissing.args b/compiler/testData/cli/js/sourceMapRootMissing.args index 278e796ffef..5c3dee330bf 100644 --- a/compiler/testData/cli/js/sourceMapRootMissing.args +++ b/compiler/testData/cli/js/sourceMapRootMissing.args @@ -2,9 +2,15 @@ $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 --Xforce-deprecated-legacy-compiler-usage +-Xir-produce-js +-Xir-only +-libraries +$STDLIB_JS$ -source-map -source-map-base-dirs $TESTDATA_DIR$/sourceMapRoot/foo --output -$TEMP_DIR$/out.js +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out + diff --git a/compiler/testData/cli/js/sourceMapRootMissing.out b/compiler/testData/cli/js/sourceMapRootMissing.out index d86bac9de59..e4bc79944e6 100644 --- a/compiler/testData/cli/js/sourceMapRootMissing.out +++ b/compiler/testData/cli/js/sourceMapRootMissing.out @@ -1 +1,4 @@ +info: produce executable: $TMP_DIR$ +info: cache directory: null +info: executable production duration: [time] OK diff --git a/compiler/testData/cli/js/sourceMapRootMultiple.args b/compiler/testData/cli/js/sourceMapRootMultiple.args index 93d537c8d32..1235e383f7b 100644 --- a/compiler/testData/cli/js/sourceMapRootMultiple.args +++ b/compiler/testData/cli/js/sourceMapRootMultiple.args @@ -1,8 +1,14 @@ $TESTDATA_DIR$/sourceMapRoot/foo/file1.kt $TESTDATA_DIR$/sourceMapRoot/bar/file2.kt --Xforce-deprecated-legacy-compiler-usage +-Xir-produce-js +-Xir-only +-libraries +$STDLIB_JS$ -source-map -source-map-base-dirs $TESTDATA_DIR$/foo:$TESTDATA_DIR$/bar --output -$TEMP_DIR$/out.js +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out + diff --git a/compiler/testData/cli/js/sourceMapRootMultiple.out b/compiler/testData/cli/js/sourceMapRootMultiple.out index d86bac9de59..e4bc79944e6 100644 --- a/compiler/testData/cli/js/sourceMapRootMultiple.out +++ b/compiler/testData/cli/js/sourceMapRootMultiple.out @@ -1 +1,4 @@ +info: produce executable: $TMP_DIR$ +info: cache directory: null +info: executable production duration: [time] OK diff --git a/compiler/testData/cli/js/suppressAllWarningsJS.args b/compiler/testData/cli/js/suppressAllWarningsJS.args index 261fcf75d9d..910af09fc96 100644 --- a/compiler/testData/cli/js/suppressAllWarningsJS.args +++ b/compiler/testData/cli/js/suppressAllWarningsJS.args @@ -1,5 +1,10 @@ $TESTDATA_DIR$/../warnings.kt --Xforce-deprecated-legacy-compiler-usage +-Xir-produce-klib-dir +-Xir-only +-libraries +$STDLIB_JS$ -nowarn --output -$TEMP_DIR$/out.js +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out diff --git a/compiler/testData/cli/js/withFolderAsLib.args b/compiler/testData/cli/js/withFolderAsLib.args index 840dc4c60a5..0aea7d676ba 100644 --- a/compiler/testData/cli/js/withFolderAsLib.args +++ b/compiler/testData/cli/js/withFolderAsLib.args @@ -1,6 +1,9 @@ $TESTDATA_DIR$/withLib.kt --Xforce-deprecated-legacy-compiler-usage +-Xir-produce-klib-dir +-Xir-only -libraries -$TESTDATA_DIR$/folderAsLib --output -$TEMP_DIR$/out.js +$STDLIB_JS$:$TESTDATA_DIR$/folderAsLib +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out diff --git a/compiler/testData/cli/js/withFolderAsLib.test b/compiler/testData/cli/js/withFolderAsLib.test index cc68ed467c9..103cfa3c288 100644 --- a/compiler/testData/cli/js/withFolderAsLib.test +++ b/compiler/testData/cli/js/withFolderAsLib.test @@ -1 +1 @@ -// EXISTS: out.js +// EXISTS: default/manifest diff --git a/compiler/testData/cli/js/withLib.args b/compiler/testData/cli/js/withLib.args index 9f53df1a6b1..69ac616e557 100644 --- a/compiler/testData/cli/js/withLib.args +++ b/compiler/testData/cli/js/withLib.args @@ -1,6 +1,9 @@ $TESTDATA_DIR$/withLib.kt --Xforce-deprecated-legacy-compiler-usage +-Xir-produce-klib-dir +-Xir-only -libraries -$TESTDATA_DIR$/lib/LibraryExample.jar --output -$TEMP_DIR$/out.js +$STDLIB_JS$:$TESTDATA_DIR$/lib/LibraryExample.klib +-ir-output-dir +$TEMP_DIR$ +-ir-output-name +out diff --git a/compiler/testData/cli/js/withLib.test b/compiler/testData/cli/js/withLib.test index cc68ed467c9..103cfa3c288 100644 --- a/compiler/testData/cli/js/withLib.test +++ b/compiler/testData/cli/js/withLib.test @@ -1 +1 @@ -// EXISTS: out.js +// EXISTS: default/manifest 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 d7c2f37f73a..3bbe8075344 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/cli/AbstractCliTest.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/cli/AbstractCliTest.java @@ -84,13 +84,22 @@ public abstract class AbstractCliTest extends TestCaseWithTmpdir { } @NotNull - public static String getNormalizedCompilerOutput(@NotNull String pureOutput, @Nullable ExitCode exitCode, @NotNull String testDataDir) { + public static String getNormalizedCompilerOutput( + @NotNull String pureOutput, + @Nullable ExitCode exitCode, + @NotNull String testDataDir, + @NotNull String tmpdir + ) { String testDataAbsoluteDir = new File(testDataDir).getAbsolutePath(); + String tmpDirAbsoluteDir = new File(tmpdir).getAbsolutePath(); String normalizedOutputWithoutExitCode = StringUtil.convertLineSeparators(pureOutput) .replace(testDataAbsoluteDir, TESTDATA_DIR) .replace(FileUtil.toSystemIndependentName(testDataAbsoluteDir), TESTDATA_DIR) .replace(PathUtil.getKotlinPathsForDistDirectory().getHomePath().getAbsolutePath(), "$PROJECT_DIR$") .replace(PathUtil.getKotlinPathsForDistDirectory().getHomePath().getParentFile().getAbsolutePath(), "$DIST_DIR$") + .replace(org.jetbrains.kotlin.konan.file.File.Companion.getUserDir().getAbsolutePath(), "$USER_DIR$") + .replace(tmpDirAbsoluteDir, "$TMP_DIR$") + .replaceAll("info: executable production duration: \\d+ms", "info: executable production duration: [time]") .replace("expected version is " + JvmMetadataVersion.INSTANCE, "expected version is $ABI_VERSION$") .replace("expected version is " + JsMetadataVersion.INSTANCE, "expected version is $ABI_VERSION$") .replace("compiler version " + JvmMetadataVersion.INSTANCE, "compiler version $ABI_VERSION$") @@ -115,7 +124,10 @@ public abstract class AbstractCliTest extends TestCaseWithTmpdir { Pair outputAndExitCode = executeCompilerGrabOutput(compiler, readArgs(fileName, tmpdir.getPath())); String actual = getNormalizedCompilerOutput( - outputAndExitCode.getFirst(), outputAndExitCode.getSecond(), new File(fileName).getParent() + outputAndExitCode.getFirst(), + outputAndExitCode.getSecond(), + new File(fileName).getParent(), + tmpdir.getAbsolutePath() ); File outFile = new File(fileName.replaceFirst("\\.args$", ".out")); @@ -285,6 +297,9 @@ public abstract class AbstractCliTest extends TestCaseWithTmpdir { ).replace( "$JDK_17$", KtTestUtil.getJdk17Home().getPath() + ).replace( + "$STDLIB_JS$", + PathUtil.getKotlinPathsForCompiler().getJsStdLibJarPath().getAbsolutePath() ); } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractKotlinCompilerIntegrationTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractKotlinCompilerIntegrationTest.kt index 4d2b8fdeabd..6e8a530a763 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractKotlinCompilerIntegrationTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractKotlinCompilerIntegrationTest.kt @@ -132,7 +132,12 @@ abstract class AbstractKotlinCompilerIntegrationTest : TestCaseWithTmpdir() { } protected fun normalizeOutput(output: Pair): String { - return AbstractCliTest.getNormalizedCompilerOutput(output.first, output.second, testDataDirectory.path).removeFirWarning() + return AbstractCliTest.getNormalizedCompilerOutput( + output.first, + output.second, + testDataDirectory.path, + tmpdir.absolutePath + ).removeFirWarning() .replace(FileUtil.toSystemIndependentName(tmpdir.absolutePath), "\$TMP_DIR\$") } diff --git a/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java index 27187f6bc49..6aa116fd55e 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java @@ -1318,11 +1318,6 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/js/firMppWithKlib.args"); } - @TestMetadata("inlineCycle.args") - public void testInlineCycle() throws Exception { - runTest("compiler/testData/cli/js/inlineCycle.args"); - } - @TestMetadata("jsExtraHelp.args") public void testJsExtraHelp() throws Exception { runTest("compiler/testData/cli/js/jsExtraHelp.args"); @@ -1358,21 +1353,6 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/js/libraryDirNotFound.args"); } - @TestMetadata("moduleWithMetadataOnlyDependency.args") - public void testModuleWithMetadataOnlyDependency() throws Exception { - runTest("compiler/testData/cli/js/moduleWithMetadataOnlyDependency.args"); - } - - @TestMetadata("modulesWithSameNames.args") - public void testModulesWithSameNames() throws Exception { - runTest("compiler/testData/cli/js/modulesWithSameNames.args"); - } - - @TestMetadata("modulesWithSameNamesAndFunc.args") - public void testModulesWithSameNamesAndFunc() throws Exception { - runTest("compiler/testData/cli/js/modulesWithSameNamesAndFunc.args"); - } - @TestMetadata("nonExistingKotlinHome.args") public void testNonExistingKotlinHome() throws Exception { runTest("compiler/testData/cli/js/nonExistingKotlinHome.args"); @@ -1388,21 +1368,6 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/js/notValidLibraryDir.args"); } - @TestMetadata("outputIsDirectory.args") - public void testOutputIsDirectory() throws Exception { - runTest("compiler/testData/cli/js/outputIsDirectory.args"); - } - - @TestMetadata("outputPostfixFileNotFound.args") - public void testOutputPostfixFileNotFound() throws Exception { - runTest("compiler/testData/cli/js/outputPostfixFileNotFound.args"); - } - - @TestMetadata("outputPrefixFileNotFound.args") - public void testOutputPrefixFileNotFound() throws Exception { - runTest("compiler/testData/cli/js/outputPrefixFileNotFound.args"); - } - @TestMetadata("perFileWithValidModuleKind.args") public void testPerFileWithValidModuleKind() throws Exception { runTest("compiler/testData/cli/js/perFileWithValidModuleKind.args"); diff --git a/compiler/tests/org/jetbrains/kotlin/cli/LauncherScriptTest.kt b/compiler/tests/org/jetbrains/kotlin/cli/LauncherScriptTest.kt index 327c1463f76..6abca9be9f1 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/LauncherScriptTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/cli/LauncherScriptTest.kt @@ -56,12 +56,12 @@ class LauncherScriptTest : TestCaseWithTmpdir() { val stdout = AbstractCliTest.getNormalizedCompilerOutput( StringUtil.convertLineSeparators(process.inputStream.bufferedReader().use { it.readText() }), - null, testDataDirectory + null, testDataDirectory, tmpdir.absolutePath ) val stderr = AbstractCliTest.getNormalizedCompilerOutput( StringUtil.convertLineSeparators(process.errorStream.bufferedReader().use { it.readText() }), - null, testDataDirectory + null, testDataDirectory, tmpdir.absolutePath ).replace("Picked up [_A-Z]+:.*\n".toRegex(), "") .replace("The system cannot find the file specified", "No such file or directory") // win -> unix process.waitFor(10, TimeUnit.SECONDS) @@ -145,9 +145,14 @@ class LauncherScriptTest : TestCaseWithTmpdir() { "kotlinc-js", "$testDataDirectory/emptyMain.kt", "-nowarn", - "-Xforce-deprecated-legacy-compiler-usage", - "-output", - File(tmpdir, "out.js").path, + "-libraries", + PathUtil.kotlinPathsForCompiler.jsStdLibJarPath.absolutePath, + "-Xir-produce-klib-dir", + "-Xir-only", + "-ir-output-dir", + tmpdir.path, + "-ir-output-name", + "out", environment = mapOf("JAVA_HOME" to KtTestUtil.getJdk8Home().absolutePath) ) } diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/JavaModulesIntegrationTest.kt b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/JavaModulesIntegrationTest.kt index 02ad3ef0d33..c94a1509491 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/JavaModulesIntegrationTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/JavaModulesIntegrationTest.kt @@ -65,7 +65,7 @@ abstract class JavaModulesIntegrationTest(private val jdkVersion: Int, private v return { actual -> KotlinTestUtils.assertEqualsToFile( expectedFile, - getNormalizedCompilerOutput(actual, null, testDataPath) + getNormalizedCompilerOutput(actual, null, testDataPath, tmpdir.absolutePath) .replace((System.getenv("JDK_11_0") ?: System.getenv("JDK_11")).replace("\\", "/"), "\$JDK11") .replace((System.getenv("JDK_17_0") ?: System.getenv("JDK_17")).replace("\\", "/"), "\$JDK17") ) diff --git a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/CompilerOutputTest.kt b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/CompilerOutputTest.kt index 6daf3a24f9d..a8cada50fd5 100644 --- a/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/CompilerOutputTest.kt +++ b/native/native.tests/tests/org/jetbrains/kotlin/konan/blackboxtest/CompilerOutputTest.kt @@ -88,10 +88,12 @@ class CompilerOutputTest : AbstractNativeSimpleTest() { } private fun normalizeOutput(output: String, exitCode: ExitCode): String { + val dir = "compiler/testData/compileKotlinAgainstCustomBinaries/" return AbstractCliTest.getNormalizedCompilerOutput( output, exitCode, - "compiler/testData/compileKotlinAgainstCustomBinaries/" + dir, + dir ) } } diff --git a/plugins/imports-dumper/tests/org/jetbrains/kotlin/importsDumper/ImportsDumperTest.kt b/plugins/imports-dumper/tests/org/jetbrains/kotlin/importsDumper/ImportsDumperTest.kt index 02a35c5b95e..c5e2703fbdc 100644 --- a/plugins/imports-dumper/tests/org/jetbrains/kotlin/importsDumper/ImportsDumperTest.kt +++ b/plugins/imports-dumper/tests/org/jetbrains/kotlin/importsDumper/ImportsDumperTest.kt @@ -64,7 +64,7 @@ class ImportsDumperTest : TestCaseWithTmpdir() { ) ) - return getNormalizedCompilerOutput(output, exitCode, testDataDir.path) + return getNormalizedCompilerOutput(output, exitCode, testDataDir.path, tmpDir.absolutePath) } }