From 148d8c9246710824a83a0c236b4272e6e67edece Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Wed, 5 Jul 2023 07:10:06 +0000 Subject: [PATCH] [Gradle, JS] Migrate JS cli tests to ir backend --- .../jetbrains/kotlin/ir/backend/js/klib.kt | 2 +- compiler/testData/cli/js/createMetadata.args | 12 +++-- compiler/testData/cli/js/createMetadata.test | 4 +- .../cli/js/folderAsLib/LibraryExample.js | 44 ------------------ .../cli/js/folderAsLib/LibraryExample.meta.js | 1 - .../LibraryExample/library/sample/sample.kjsm | Bin 432 -> 0 bytes .../cli/js/folderAsLib/default/ir/bodies.knb | Bin 0 -> 1617 bytes .../js/folderAsLib/default/ir/debugInfo.knd | Bin 0 -> 98 bytes .../cli/js/folderAsLib/default/ir/files.knf | Bin 0 -> 117 bytes .../folderAsLib/default/ir/irDeclarations.knd | Bin 0 -> 612 bytes .../js/folderAsLib/default/ir/signatures.knt | Bin 0 -> 771 bytes .../cli/js/folderAsLib/default/ir/strings.knt | Bin 0 -> 647 bytes .../cli/js/folderAsLib/default/ir/types.knt | Bin 0 -> 115 bytes .../js/folderAsLib/default/linkdata/module | 2 + .../package_library.sample/0_sample.knm | Bin 0 -> 448 bytes .../cli/js/folderAsLib/default/manifest | 8 ++++ compiler/testData/cli/js/inlineCycle.args | 4 -- compiler/testData/cli/js/inlineCycle.kt | 20 -------- compiler/testData/cli/js/inlineCycle.out | 7 --- compiler/testData/cli/js/languageVersion.args | 11 +++-- .../testData/cli/js/lib/LibraryExample.jar | Bin 2967 -> 0 bytes .../testData/cli/js/lib/LibraryExample.klib | Bin 0 -> 4960 bytes compiler/testData/cli/js/lib/ReadMe.md | 2 +- .../testData/cli/js/libraryDirNotFound.args | 11 +++-- .../testData/cli/js/libraryDirNotFound.out | 2 +- .../js/moduleWithMetadataOnlyDependency.args | 13 ------ .../js/moduleWithMetadataOnlyDependency.out | 1 - .../js/moduleWithMetadataOnlyDependency.test | 5 -- .../testData/cli/js/modulesWithSameNames.args | 12 ----- .../testData/cli/js/modulesWithSameNames.out | 2 - .../testData/cli/js/modulesWithSameNames.test | 1 - .../cli/js/modulesWithSameNamesAndFunc.args | 12 ----- .../cli/js/modulesWithSameNamesAndFunc.out | 2 - .../cli/js/modulesWithSameNamesAndFunc.test | 1 - .../testData/cli/js/notValidLibraryDir.args | 11 +++-- .../testData/cli/js/notValidLibraryDir.out | 8 +--- .../testData/cli/js/outputIsDirectory.args | 4 -- .../testData/cli/js/outputIsDirectory.out | 2 - .../testData/cli/js/outputIsDirectory.test | 1 - .../cli/js/outputPostfixFileNotFound.args | 6 --- .../cli/js/outputPostfixFileNotFound.out | 2 - .../cli/js/outputPostfixFileNotFound.test | 1 - .../cli/js/outputPrefixFileNotFound.args | 6 --- .../cli/js/outputPrefixFileNotFound.out | 2 - .../cli/js/outputPrefixFileNotFound.test | 1 - .../cli/js/reifiedIntersectionType.args | 11 +++-- .../cli/js/separateModules/sepModule1.kt | 6 --- .../cli/js/separateModules/sepModule2.kt | 13 ------ .../cli/js/separateModules/sepModule3.kt | 10 ---- .../cli/js/separateModules/sepModule4.kt | 17 ------- compiler/testData/cli/js/simple2js.args | 11 +++-- compiler/testData/cli/js/simple2js.test | 2 +- compiler/testData/cli/js/sourceMap.args | 11 +++-- compiler/testData/cli/js/sourceMap.out | 3 ++ .../testData/cli/js/sourceMapCharEscape.args | 11 +++-- .../testData/cli/js/sourceMapCharEscape.out | 3 ++ .../js/sourceMapDuplicateRelativePaths.args | 11 +++-- .../js/sourceMapDuplicateRelativePaths.out | 4 +- .../cli/js/sourceMapEmbedSources.args | 11 +++-- .../testData/cli/js/sourceMapEmbedSources.out | 3 ++ compiler/testData/cli/js/sourceMapPrefix.args | 11 +++-- compiler/testData/cli/js/sourceMapPrefix.out | 3 ++ .../cli/js/sourceMapRelativeRoot.args | 23 +++++---- .../testData/cli/js/sourceMapRelativeRoot.out | 3 ++ .../cli/js/sourceMapRelativeRoot.test | 2 - .../testData/cli/js/sourceMapRootAuto.args | 11 +++-- .../testData/cli/js/sourceMapRootAuto.out | 3 ++ .../testData/cli/js/sourceMapRootManual.args | 11 +++-- .../testData/cli/js/sourceMapRootManual.out | 3 ++ .../testData/cli/js/sourceMapRootMissing.args | 12 +++-- .../testData/cli/js/sourceMapRootMissing.out | 3 ++ .../cli/js/sourceMapRootMultiple.args | 12 +++-- .../testData/cli/js/sourceMapRootMultiple.out | 3 ++ .../cli/js/suppressAllWarningsJS.args | 11 +++-- compiler/testData/cli/js/withFolderAsLib.args | 11 +++-- compiler/testData/cli/js/withFolderAsLib.test | 2 +- compiler/testData/cli/js/withLib.args | 11 +++-- compiler/testData/cli/js/withLib.test | 2 +- .../jetbrains/kotlin/cli/AbstractCliTest.java | 19 +++++++- .../AbstractKotlinCompilerIntegrationTest.kt | 7 ++- .../kotlin/cli/CliTestGenerated.java | 35 -------------- .../kotlin/cli/LauncherScriptTest.kt | 15 ++++-- .../compiler/JavaModulesIntegrationTest.kt | 2 +- .../konan/blackboxtest/CompilerOutputTest.kt | 4 +- .../kotlin/importsDumper/ImportsDumperTest.kt | 2 +- 85 files changed, 243 insertions(+), 328 deletions(-) delete mode 100644 compiler/testData/cli/js/folderAsLib/LibraryExample.js delete mode 100644 compiler/testData/cli/js/folderAsLib/LibraryExample.meta.js delete mode 100644 compiler/testData/cli/js/folderAsLib/LibraryExample/library/sample/sample.kjsm create mode 100644 compiler/testData/cli/js/folderAsLib/default/ir/bodies.knb create mode 100644 compiler/testData/cli/js/folderAsLib/default/ir/debugInfo.knd create mode 100644 compiler/testData/cli/js/folderAsLib/default/ir/files.knf create mode 100644 compiler/testData/cli/js/folderAsLib/default/ir/irDeclarations.knd create mode 100644 compiler/testData/cli/js/folderAsLib/default/ir/signatures.knt create mode 100644 compiler/testData/cli/js/folderAsLib/default/ir/strings.knt create mode 100644 compiler/testData/cli/js/folderAsLib/default/ir/types.knt create mode 100644 compiler/testData/cli/js/folderAsLib/default/linkdata/module create mode 100644 compiler/testData/cli/js/folderAsLib/default/linkdata/package_library.sample/0_sample.knm create mode 100644 compiler/testData/cli/js/folderAsLib/default/manifest delete mode 100644 compiler/testData/cli/js/inlineCycle.args delete mode 100644 compiler/testData/cli/js/inlineCycle.kt delete mode 100644 compiler/testData/cli/js/inlineCycle.out delete mode 100644 compiler/testData/cli/js/lib/LibraryExample.jar create mode 100644 compiler/testData/cli/js/lib/LibraryExample.klib delete mode 100644 compiler/testData/cli/js/moduleWithMetadataOnlyDependency.args delete mode 100644 compiler/testData/cli/js/moduleWithMetadataOnlyDependency.out delete mode 100644 compiler/testData/cli/js/moduleWithMetadataOnlyDependency.test delete mode 100644 compiler/testData/cli/js/modulesWithSameNames.args delete mode 100644 compiler/testData/cli/js/modulesWithSameNames.out delete mode 100644 compiler/testData/cli/js/modulesWithSameNames.test delete mode 100644 compiler/testData/cli/js/modulesWithSameNamesAndFunc.args delete mode 100644 compiler/testData/cli/js/modulesWithSameNamesAndFunc.out delete mode 100644 compiler/testData/cli/js/modulesWithSameNamesAndFunc.test delete mode 100644 compiler/testData/cli/js/outputIsDirectory.args delete mode 100644 compiler/testData/cli/js/outputIsDirectory.out delete mode 100644 compiler/testData/cli/js/outputIsDirectory.test delete mode 100644 compiler/testData/cli/js/outputPostfixFileNotFound.args delete mode 100644 compiler/testData/cli/js/outputPostfixFileNotFound.out delete mode 100644 compiler/testData/cli/js/outputPostfixFileNotFound.test delete mode 100644 compiler/testData/cli/js/outputPrefixFileNotFound.args delete mode 100644 compiler/testData/cli/js/outputPrefixFileNotFound.out delete mode 100644 compiler/testData/cli/js/outputPrefixFileNotFound.test delete mode 100644 compiler/testData/cli/js/separateModules/sepModule1.kt delete mode 100644 compiler/testData/cli/js/separateModules/sepModule2.kt delete mode 100644 compiler/testData/cli/js/separateModules/sepModule3.kt delete mode 100644 compiler/testData/cli/js/separateModules/sepModule4.kt 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 f53578c8ac0ac1a628c156f0bcb52b8f6bd937d9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 432 zcmaKnK~BRk5JhdraV7&46E;yKHXHzj8~~}nB2+>`a01g-`F7!4Mx!HXZ7zVxoL9jbTV zySl+(+^jJCG;V1zpcrxL=dEvS(_f>U`gVoNek_e!V07!fv!=n&_cIy+Gqaf8`N|^n z{-y8g<_*=LQETdMTvf 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 0000000000000000000000000000000000000000..0a81e515810bee384315cf9a719c796f5adb9c53 GIT binary patch literal 1617 zcmbVM-AhzK6rZ!MdN`p@lOOB!;d%(+(x0Ya1<6GCia zTxZNM+8B~?fHB5sVw`6zGp2vCJi&6oZFy>DMe|`Ne{ham&X~3TJA!_p>hGw^FqV3aLsWz3U zGE;Xl#)d(ua#%ZCm$ttv)dJWz*o+oaHZ@syR4*qcM| z%5tRGjNTH^OQ&l66etcp%%bU1cj?+&m?A~N*1)L-S?tu3u|;xhc^b37P=(o~JKY31 z`}}IJ&}FM#k5a!6y=V@qZfe)9XnIr&ZN_U6V0%S*~>_taEYxwaZ;ArUWS`xi9M-C(mwEa)u+-umf*hSA+@s=w0piYt480U ztE(_Um#iszHr1Dppb=%!+SumGaA`J(5boQ8B8DuXI?{ibHshla*VF=DKmBbgSO5S3 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..1fbc5685498b778464433904e5f558272ed6cc52 GIT binary patch literal 98 zcmZQzU|?imV2A=@5FO;^>FVR65D?@a;2IPX8Smui?Ct629uE=DOUzBRDoe~MO;sqV tEJ(G=&M(Qy%+vGCD^V!REY3{I%*iaNv??gdEK4j&RftZ@%uCFP1pt(t9cBOk literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..e5ae5257418a24b82262776c3eddec63a8d920e8 GIT binary patch literal 117 zcmV~$F%H5o3;;kIwn$yNfOtgx3D{T|kjm&p5tuqnD01BQZL334cUCVWVXaS%)Y(bnVt} zsBY1%L+Ht05cMPac3l$P9p1yd^FHro*@ zK|(N$WqJ!%9CbMjAY7gHA4!X0S}|FGW%8Uk@|+#YID8OFlkrsvLYna%gQW0GvOe!L z%M&~q^T%TR)pxX4oO?S^s=$44&xq`O4kOGl%=Tdug>+GIKisU*rW&<~l?>ryeT>0&qLl_bv3Eb0KtXivk?WgyU*Ph7fIr7-+ebiu&m2sOhLT$>x z&n;GdZu{?3l!rJC*fc1J>I_v)9>ECX#K|^upuCQroTXHljoQX2|M; z#Otp=TBW_IQ(DpwZ~y(BdNe-KzB)8un$`fUuO+vhWpB<@sm@`+-PvN+TWZ!GQi1HD zUj)9bUHdS-|0YwT+&D_?aObdLP82p8wapu2Y?tPEcaatc631Ey^`GP-RI!;4aVB3ZoUo)&$qqYWV5-W4|-Ay zW2~FfyJw*4tt>owHIuuf4lp9Zf~!6zWAy|^&)W1HG$w!TrqY#4o{C=e;z%4;y_eT3 a)8*Ecj`9MGJ#B6I{{6x#)y`cmqVE7}C$f70 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..af152b59a7b62ba794e0c5d72f92e0d58e7c77c8 GIT binary patch literal 647 zcmYL_O^?$s5Qf9@{c%A8B*cvq9FRaz|og~SvBsu$=B*{nQK639A=lnLVu_n25(kT*mk;ljrgnB4a59!qN5Fwq` zR8Jbk7szXbdS4<`^9Xr`(EbBt)+o~KS)2W7eRisQj`0~n{!~vMPp$bes__`qez1B_ zW@LR|z>?QcT={5?<1P*j>a~wM<1Pn#2u-H;@ zceoiOmttMXh6z?d2V$BynWcCIwkiJ~NwPeLwq1(_-Xf%1zaPBQE`C@+4T5!0$bxlD z<|S)eSwWS7*!tlZeH%x-_Vxef+;65SpWg0N*yX<0`qx3(ka=&la`;dhd!inlvSx&@ y^l>3OsG7B4;zFJ?!C6*9+z;>NR4)IRxRYBIBDTY~ygYT)ZO7^yq<|dwIf#EMYnxaA literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..2fe2519b7531c572d8fe4233e498e39d72c4a66c GIT binary patch literal 115 zcmZQzU|?imV8{kyP9SCnVs0o6Vq;(}R)IDq2_`L0fi^Y?CM70DMvw>xPy|RxK_~?X SWd)(UAXI<^14v1L1QP&nLkcDU literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..4b9f353d2dab8bed2820c13539f8f77f6385807d GIT binary patch literal 448 zcmYk2!A`53IW;-V`PFea5~V)P3tG(sqyT8fdKiHZN>kMIe^ zC2Ne40K(R`f1m6N6M1*}heh8`|W8D~FU(IMogg4m>&V z)VEp}tp-^=PEMNz))vB)@?W`Q1iQ-s&$Qp4uKf*u_QBMr@|fj|f%G`l+iVCr3Rt*y zOpl>Qjh 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 8f4c227bcb97895ae6c27f9a0af5a84b0c30f962..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2967 zcmb7`c{r478^B*{AyL`M?vQn|OdR_*mh9W-vm7+mVQdpkoF=lJA(XAG5!thZvSo;| zC6kF9ONT)WLegN8eAM~s$mjH(_r0FydftD2_w(G(eckWR>^v1UJ+Sxi2kRMrUi>*R z0X%?_*M&frz{|Qw7r4KVn~b#;9Y7^nn{I2eJA#l500lLX3IIM&W`}~<4}yHYaK8bi z{t1xxa3JEljUK{f**)V?fOJvMa3SE8g(w98RPBy4KjePFOMAl*@XxvURGn_Smyhpq zaV1gHq#eYp3-2=ciHhYE*jyOQ14QuvB~iM?k&%mxpP4BhPiD}`*IMxI=+zFT7oKr>+_SZmvmr{Dpr8m){al{k zk_03tplA%`Fx;)2k~kAHwiHrgn3PP+ZOxCgS5!Fo^$`P5plKFNM79{7?7)k&@(*nSW z12-WJLwwD6^n-&Lx1KN^12LoKD(my;MeSL_Z>&Er&0yBzq67=`7L~}ZMj?Z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&(q^} zv8T-KN*ThmnsGou8|{pJ_Xe}3P3u&ExKww$>deDtHUn}!k1Th z<~w?4tSjnz^Tw=WQwF20E8cxi$s=fKKknd*ts}f5+$7`?Qj9C2iwSkTDb}&120}+~ zp3N^FaxFY3`Yhg~x7ZPWh{-p-{hAJw)}k{B)!?}qaKPo=5}ur8sAqS`N%!9xY` zM*3jUDE}Q4L8vwBQR0c5pIxzJPc89g=H{?Y10My31oR07Jh=mIKkPCr@+ z-t!*r!qhZXnxM}^6551a-R_ZE6*A^~mE!F$2z<(a^@03U!zJ`|;5*0R4M8my{6TbX zZMWZ6_0XfmT&ICJLWdNebvm{hs$|%pxX8Fj^oz=(FW24usqs=R+6(LB>5dFQ?)=bp ze(I2&?0u1Lo=6PJ*$eB6N8*DO{E^bjFe;Cua@=chb$rq+?dtSX%@3`3_f))X_AR*W zhdVWKwH*aKP^A`kOr{uF8D(~(B~qJkYVHoQEg>qtfT($;eoe%y*xxPAIRn`isWPUS z*u&wFX|<3t?yKB6X2D@g?yobd!^G{KJqbT1ar0Iw1~I^4xfBVrhxI5ug+icn59!Rc zEBr^XvYz+SW@YX+GO6GAqP`qQ|0n-FwYQ(2-hSzV5jPAs&a@E|XUi-@XC@R~4dtu! zcH7%tuEvwH99+okSw~FMJQ9M){Cc*g%t@~?(anJT;#2UfF0>qU?Q_Y)an8dmCM-jzjxt@er2#+rI?V3wh#VB9ub|rVOE-Hp?659_WSoZ9f+HYE~bb z$QjF*2UHmm4h_H>>t78;v62KYFi~cpqXzDRlnlCaBTMaoA1#5Zt=$Dh+g(zl4p8Jyi1B+LDBt`HJ$+fr?30pzMO8tuClhu9Wu;RH$ESja_iGr2sXK zk@ABIM^hM3!FH1 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) } }