387 Commits

Author SHA1 Message Date
Dmitry Gridin 0839b6a62b [CHERRY PICKED FROM IJ] [kotlin] migrate some io operations to nio
FLEET-T-2032

GitOrigin-RevId: a616d57c763cda61386ddb754ea45ee075764eaf
Original commit: https://github.com/JetBrains/intellij-community/commit/99b6620c424773a42f44fdf398c98fbaa3b55b5c
2022-01-12 15:10:54 +01:00
Mikhail Zarechenskiy 9c9219b285 [CHERRY PICKED FROM IJ] KTIJ-7656 Add test to check ASM version of the bundled compiler
The original issue was fixed by using the correct version of the compiler in https://github.com/JetBrains/intellij-kotlin/commit/9695fdcd07f7fcea1ea96030af4106b5a89cd007. This version of the compiler was built against 202 bunch that contains ASM8, the previous one was erroneously built against 201 with ASM7.

 Note that currently it's not trivial to write functional test because we need Java 15 for it

GitOrigin-RevId: 900410b89902a6a33d8e2285fe24806cd671dff6
Original commit: https://github.com/JetBrains/intellij-community/commit/e6cfeda5839ef1789b94d20b7435a1d2a867e2c4
2022-01-12 15:10:54 +01:00
Andrei Klunnyi f3d5a71c34 [CHERRY PICKED FROM IJ] Test marathon: MultiplatformJpsTestWithGeneratedContentGenerated (Js)
The following tests are outdated (JPS/Js is no longer supported):
- MultiplatformJpsTestWithGeneratedContentGenerated$Simple.testEditingPJsKotlin
- MultiplatformJpsTestWithGeneratedContentGenerated$SimpleNewMpp.testEditingPJsKotlin

GitOrigin-RevId: e4c4b5a75b39803bc5df966a3d957e5ab0f253b1
Original commit: https://github.com/JetBrains/intellij-community/commit/49542e2cce00b08f87c0c91093dff4e8c9df1032
2022-01-12 15:10:53 +01:00
Andrei Klunnyi 4e260345a4 [CHERRY PICKED FROM IJ] Test marathon: MultiplatformJpsTestWithGeneratedContentGenerated (Native)
The following tests are outdated (JPS/Native is no longer supported):
- MultiplatformJpsTestWithGeneratedContentGenerated$IgnoreAndWarnAboutNative.testEditingCKotlin
- MultiplatformJpsTestWithGeneratedContentGenerated$Simple.testEditingCKotlin
- MultiplatformJpsTestWithGeneratedContentGenerated$SimpleNewMpp.testEditingCKotlin

GitOrigin-RevId: 6e81a4a86a480563992b6fbde4ecbf47571bb49e
Original commit: https://github.com/JetBrains/intellij-community/commit/2a3a84bfa69853efd0be2eaca183cd615af03080
2022-01-12 15:10:53 +01:00
Dmitry Gridin f33ad62bc2 [CHERRY PICKED FROM IJ] [tests] IncrementalRenameModuleTest: fix path
IncrementalRenameModuleTest.testRenameModule: fixed

GitOrigin-RevId: e0f5c22dcc3b65c7814b6c1382d195aac7a7915c
Original commit: https://github.com/JetBrains/intellij-community/commit/79762233dcdca5d7265df93047a2243615cf5f83
2022-01-12 15:10:52 +01:00
Yan Zhulanow f780b7b4f7 [CHERRY PICKED FROM IJ] Minor: Change checkIsAndroidStudio() method name so it better says what it does
(cherry picked from commit d1b19564a9873fbdf4818a7ee325c771d0d8db7a)

GitOrigin-RevId: ae00f60d3dfc79aed15814de4e81a93e6a07008d
Original commit: https://github.com/JetBrains/intellij-community/commit/36f66c2a44b2ea42ba796a3a31f63d4751588e99
2022-01-12 15:10:50 +01:00
Yan Zhulanow 24e195d7c1 [CHERRY PICKED FROM IJ] Fix tests with Gradle project importer
Adds explicit 'android.dir' preference to 'local.properties' of a Gradle project so Android components don't get in the way.

(cherry picked from commit 3b83f67587bb04810f5de50d6a29ab7963bd24ec)

GitOrigin-RevId: 6d7063bb8c5253c828f9df22efdfdaf2910b99c3
Original commit: https://github.com/JetBrains/intellij-community/commit/1e326c986175c2bb14ad6711caafb96ff85def4a
2022-01-12 15:10:50 +01:00
Yan Zhulanow 24ab459e3a [CHERRY PICKED FROM IJ] Disable JPS tests when run against Android Studio
(cherry picked from commit 23113fd13f02cac9163a54b0183572e826510366)

GitOrigin-RevId: 259f5ca81c749b71cc81d6c690bb73fe3af0e538
Original commit: https://github.com/JetBrains/intellij-community/commit/aa709349738e2814bf725b294e6c7dca68efd3e7
2022-01-12 15:10:50 +01:00
Dmitry Gridin ef27b134a2 [CHERRY PICKED FROM IJ] [tests] KotlinJpsBuildTest*: cleanup code
GitOrigin-RevId: 626313b2a47cab2f63a721d3de33d97af42b01fb
Original commit: https://github.com/JetBrains/intellij-community/commit/50dbdf9d30afa914978abb97f45b82cf226a5d8d
2022-01-12 15:10:49 +01:00
Dmitry Gridin 1f62859019 [CHERRY PICKED FROM IJ] [tests] fix KotlinModuleXmlGeneratorTest
GitOrigin-RevId: 7a00a761e6294793bff13cc0ea9b84d571fb714a
Original commit: https://github.com/JetBrains/intellij-community/commit/ab3886e11b285975f4e0eb4ea9f67e907de71e3c
2022-01-12 15:10:48 +01:00
Dmitry Gridin ba9bcee24d [CHERRY PICKED FROM IJ] pull up addJdk from AbstractKotlinJpsBuildTestCase to BaseKotlinJpsBuildTestCase to fix tests
GitOrigin-RevId: fd76500448ab232b34b5aef3cfa51b75be91803b
Original commit: https://github.com/JetBrains/intellij-community/commit/ad2f48e57191253bcde4b100a4536dbbed990ff1
2022-01-12 15:10:47 +01:00
Yan Zhulanow 58bc5b80a1 [CHERRY PICKED FROM IJ] Use RunAll in all Kotlin tearDown() implementations
GitOrigin-RevId: f9409eb1f5640905f46a0241b5fec9338483f331
Original commit: https://github.com/JetBrains/intellij-community/commit/58982727a601c749187a5946015c8b51b7e7789b
2022-01-12 15:10:46 +01:00
Nikita Bobko 7bbec26b2d [CHERRY PICKED FROM IJ] Fix compilation with intellij
GitOrigin-RevId: 2fa9aa992b9d4673a641a7e1d06402c78ca29400
Original commit: https://github.com/JetBrains/intellij-community/commit/0f44ee9b644fa98801aec31468edc919c1abbb9f
2022-01-12 15:10:46 +01:00
Yan Zhulanow 4ef18fe036 [CHERRY PICKED FROM IJ] Remove almost all dependencies to dist/ artifacts
'kotlin-coroutines-experimental-compat' is to migrate.

GitOrigin-RevId: 94dd58c1b38e763403b1f4252853b52d3a9d2f98
Original commit: https://github.com/JetBrains/intellij-community/commit/5b3fa35e82fe3e686328ae62d83de99e7be46dc6
2022-01-12 15:10:46 +01:00
Vladimir Dolzhenko 3acd977a36 [CHERRY PICKED FROM IJ] Disable tests those directly use compiler test data
GitOrigin-RevId: 3714ee17fbe02ee8a2809709eeb481ddfa07e086
Original commit: https://github.com/JetBrains/intellij-community/commit/a52130d32ca8dc364912e390dd2747ae1df0aa66
2022-01-12 15:10:45 +01:00
Nikita Bobko ae9d039006 [CHERRY PICKED FROM IJ] Fix compilation
GitOrigin-RevId: e64c89f5224dab28a4782ba42e0d98d102d69855
Original commit: https://github.com/JetBrains/intellij-community/commit/9063fad8cf7f6a1c8f5228288a298fa84cee3e84
2022-01-12 15:10:45 +01:00
Nikita Bobko 7d938590f9 [CHERRY PICKED FROM IJ] No more need for KotlinIdeForTestCompileRuntime use ForTestCompileRuntime instead
`KotlinIdeForTestCompileRuntime` was temp class. We don't need it
anymore because `tests-common` migrated to `kotlin-ide` repo and
`ForTestCompileRuntime` now is under our control

GitOrigin-RevId: f871531fec3aa09ad911d0dc6b9273ab32dbbf23
Original commit: https://github.com/JetBrains/intellij-community/commit/67838fa145c21747d8aa89b728ceb623e27e9676
2022-01-12 15:10:44 +01:00
Nikita Bobko e24deb8b8a [CHERRY PICKED FROM IJ] Use KotlinIdeForTestCompileRuntime instead of ForTestCompileRuntime
GitOrigin-RevId: adc692b40320957c94fd3f619cb764e4ca108419
Original commit: https://github.com/JetBrains/intellij-community/commit/f4114cf684219e95f3e33341c2a2736a94098ed6
2022-01-12 15:10:44 +01:00
Yan Zhulanow 17e336ea44 [CHERRY PICKED FROM IJ] Move the withIC() function to the test itself
GitOrigin-RevId: 196571333c115c1f24eebc048dbfcca5c2189dfa
Original commit: https://github.com/JetBrains/intellij-community/commit/1a521c2ee63b3e777b1f955b2f4cb91c28a158be
2022-01-12 15:10:41 +01:00
Alexander Udalov 46196dc1a3 Restore writing bytecode version to metadata for LV < 1.5
#KT-45323 Fixed

(cherry picked from commit 9970851684)

Original commit: d8b85debe6afe3af52a234717934aad5289d2b71
2021-03-08 11:19:12 +01:00
Alexander Likhachev d7d64b4cef Update tests after compiler properties rework
#KT-43605 Fixed

(cherry picked from commit 70d434e992)

Original commit: bb558c528239070d82f439c8c797ff38dc655a8d
2021-03-04 19:52:49 +03:00
Alexander Udalov 5c6e8fa05d Remove JvmBytecodeBinaryVersion from the compiler code
Move it to build-common where it's still used in incremental compilation
caches, and simplify a bit. In the future, it'll make sense to remove it
completely and to avoid writing it to caches. In this commit, I don't do
that to prevent the IC cache version to be updated, causing rebuilds for
all JPS projects.

 #KT-41758

(cherry picked from commit f63ffc51ae)

Original commit: 15b3f54e666c91aa19255d4887d8916a711b79c4
2021-02-23 14:16:22 +01:00
Aleksei.Cherepanov 8b38a752d8 JPS: Fix JvmMultifileClass processing for IR backend
#KT-44644 Fixed

(cherry picked from commit aa683d3b2a)

Original commit: ef3c73554fc64d9837019ed9cf9e512bbd2b20f3
2021-02-19 23:59:11 +03:00
Dmitriy Novozhilov dcf740bc26 [Test] Fix various tests according to switching to kotlin 1.5
Original commit: 4f8b12c96f
2021-01-28 13:19:30 +03:00
Alexander Udalov 382724d5e9 Update and regenerate incremental compilation tests for 1.5
Set TargetBackend.JVM_IR for these tests by default; remove the
generated IR-based test and add a new old-backend-based test. This fixes
the issue where some (3) of these tests were not properly ignored
because of incorrect target backend used in the test generator.

Also update test data for some tests which use local functions, which
are not generated to separate anonymous classes in JVM IR.

Original commit: 1deb317e0d
2021-01-28 13:19:27 +03:00
Roman Artemev bf3414c491 [IC] Add in-module tests for incremental compilation
Two tests to check recompilation when parameter with default value was
added or removed without changing use-site.

Original commit: 96ba3b873e
2021-01-26 19:23:23 +03:00
Alexander Udalov d885679e61 Regenerate tests and fir-tree
Original commit: ed9a0e514d
2021-01-03 14:53:41 +01:00
Dmitriy Novozhilov 8bce3f41fb [Test] Extract MockLibraryUtil to :compiler:tests-compiler-utils
Also provide MockLibraryUtilExt with bridges to MockLibraryUtil
  with JUnit4Assertions

Original commit: cb7b1652e7
2020-12-24 14:58:01 +03:00
Dmitriy Novozhilov deee82073b [TEST] Regenerate tests after previous commit
Original commit: bc7e18fb8a
2020-12-16 19:52:28 +03:00
Dmitriy Novozhilov b39d89fcd5 [TEST] Introduce test-infrastructure-utils module and extract common test utilities here
Original commit: c8f3a4802e
2020-12-16 19:52:22 +03:00
Andrey Uskov 780696565d Add tests for incremental compilation of sealed interfaces
Original commit: 2e607335db
2020-12-13 20:17:18 +03:00
Andrey Uskov c1a9eb9d21 IC of sealed classes
Supported case then children of sealed classes could be declared
anywhere in a module. If list of classes implementing sealing class
changes the sealed class and all its inheritors should be recompiled
(now sealed class should be compiled together with children in order
to calculate all possible inheritors at compile time) and and
invalidated (as they could have when operators).

Original commit: 36f99156fd
2020-12-13 20:17:16 +03:00
Dmitriy Novozhilov f087ba747a [IC] Add ability to pass additional compiler args to IC tests
Additional arguments should be declared in `args.txt` file in test
  directory in common CLI arguments format

Original commit: 3246e6b9ac
2020-12-09 22:54:36 +03:00
Nikolay Krasko 0b5725e656 Revert "Keep application environment alive between JPS tests"
This reverts commit 1f549f32

The revert fixes the flaky behaviour on Windows in jps-plugin tests.

java.lang.RuntimeException: java.nio.file.FileSystemException:
tempdir_path\jps-build\jslib-example.jar:
The process cannot access the file because it is being used by another process.

Can be reproduced when running KotlinJpsBuildTest after IncrementalJsJpsTestGenerated.

1. IncrementalJsJpsTestGenerated sets KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY
2. KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY disables environment clean-up.
3. No disposeApplicationEnvironment() call also means no ZipHandler.clearFileAccessorCache()
4. There's jslib-example.jar opening in JsConfig.checkLibFilesAndReportErrors()
5. File handler is not closed and tests fails in tearDown()

Affected tests:
KotlinJpsBuildTest.testKotlinJavaScriptProjectWithLibraryCustomOutputDir
KotlinJpsBuildTest.testKotlinJavaScriptProjectWithLibraryAndErrors
KotlinJpsBuildTest.testKotlinJavaScriptProjectWithLibrary
KotlinJpsBuildTest.testKotlinJavaScriptProjectWithLibraryNoCopy
KotlinJpsBuildTest.testKotlinJavaScriptProjectWithTwoModulesAndWithLibrary
KotlinJpsBuildTestIncremental.testKotlinJavaScriptProjectWithLibraryCustomOutputDir
KotlinJpsBuildTestIncremental.testKotlinJavaScriptProjectWithLibraryAndErrors
KotlinJpsBuildTestIncremental.testKotlinJavaScriptProjectWithLibrary
KotlinJpsBuildTestIncremental.testKotlinJavaScriptProjectWithLibraryNoCopy
KotlinJpsBuildTestIncremental.testKotlinJavaScriptProjectWithTwoModulesAndWithLibrary

Original commit: 2bf22caeb7
2020-12-04 14:09:36 +03:00
Nikolay Krasko b7607688fa Minor: use unique temp directories in jps-build tests
Original commit: 2d8bdcbc9b
2020-12-04 14:09:36 +03:00
Nikolay Krasko 44c925f17a Fix Daemon compiler tests on Windows
In 202 platform tearDown tries to remove temporary directory, but this
fails on Windows, because while Daemon is active directory can't be
deleted.

Original commit: 2ffedd2731
2020-12-02 14:23:32 +03:00
Dmitriy Novozhilov 5cf686b1a5 Switch to 202 platform
Original commit: eeb9b3214c
2020-11-28 14:25:19 +03:00
Ilya Gorbunov f9b0bd4792 Use new kotlin.io.path API in tests
Original commit: b2b2629e79
2020-11-20 09:03:25 +03:00
Georgy Bronnikov b154f74b99 JVM_IR: avoid descriptors when tracking inline properties
Preparing to use wrapped properties in InlineCodegen.

Original commit: 8e24256f95
2020-07-02 12:46:58 +03:00
Denis Zharkov 50725dcde2 Fix incremental compilation for calls to inner classes from supertypes
The problem became actual after bba1c88c8e634b707bb39522129d226add3fa90d

Original commit: 3ce980fd88
2020-07-01 06:55:52 +03:00
Roman Artemev b11a0d3fc6 [KLIB IC] Add test about incremental kotlin-js-stdlib-klib recompliation
Original commit: cc818025df
2020-06-22 11:30:40 +03:00
Ilya Muradyan 68619252a8 Compare lookups without respect to their order
Original commit: 7526ff9484
2020-06-18 09:51:16 +02:00
Nikita Bobko 68fbddd3d7 202: Fix NPE in BaseKotlinJpsBuildTestCase.tearDown()
Original commit: cb8addc4cd
2020-06-15 23:22:20 +03:00
Alexander Udalov f3efd88bb9 Replace appendln with appendLine in project
Original commit: 6e67e1e78d
2020-06-11 13:01:30 +02:00
Nikita Bobko ff2c453732 202: Fix compilation
Original commit: ff7576f8e4
2020-06-10 12:39:29 +03:00
Yunir Salimzyanov 9381493cff Add annotation to prevent test invocation twice
Cause: it helps to fix double inversion of muted non-flaky tests result
(KTI-216).

Original commit: 8d51b027ed
2020-05-30 22:50:34 +03:00
Yan Zhulanow d102098196 202: Fix compatibility with 202 IDEA branch (code)
Original commit: 46ac241e2f
2020-05-27 02:38:44 +09:00
Sergey Rostov 673779df69 jps: testPureJavaProject fix
Original commit: 9574ac83e4
2020-05-25 10:06:11 +03:00
Alexander Udalov 83ec05b31d Support new scheme of compilation of OptionalExpectation annotations
Instead of generating these annotation classes as package-private on
JVM, serialize their metadata to the .kotlin_module file, and load it
when compiling dependent multiplatform modules.

The problem with generating them as package-private was that
kotlin-stdlib for JVM would end up declaring symbols from other
platforms, which would include some annotations from package
kotlin.native. But using that package is discouraged by some tools
because it has a Java keyword in its name. In particular, jlink refused
to work with such artifact altogether (KT-21266).

 #KT-38652 Fixed

Original commit: 012ffa2993
2020-05-12 19:28:57 +02:00
Sergey Rostov 59993b1441 JPS: ignore removed java files
#KT-27458 Fixed

Original commit: 800fcc511a
2020-05-12 16:22:48 +03:00