Commit Graph

542 Commits

Author SHA1 Message Date
Ilya Goncharov 8c014baa28 [JS] Fix JPS tests with js part 2023-06-29 14:25:45 +00:00
Ilya Goncharov a0f86d8dd6 [JS] Remove JS legacy lookup tracker tests 2023-06-29 14:25:45 +00:00
Kirill Rakhman a50ae9db9d [FIR] Revert workaround for IC issue surfaced by KT-58335
#KT-28233
2023-05-16 09:20:57 +00:00
Aleksei.Cherepanov 6471624d0c [Gradle] Disable usePreciseJavaTracking flag for K2
Historically flag was enabled for Gradle projects, but we don't have fir-based JavaTracker for the K2 compiler for now, so we need to use a fallback strategy.
Note: it was disabled for tests with K2
Note2: after adding a fir-based java classes tracker this value should be set to true (KT-57147)

#KT-56886 Fixed

Merge-request: KT-MR-9053
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-03-09 13:41:25 +00:00
Aleksei.Cherepanov 090a58ccc4 Change allConstants test
Currently, FIR compilation of `const val b: Byte = 50 + 50` shows an error, but old compiler doesn't (it shows only warning). Since this is an incremental test, it should not be affected by compiler errors, but should only test for .kt usage without recompilation.

#KT-54991 In Progress
2023-01-30 13:45:39 +00:00
Aleksei.Cherepanov a0fa438735 Revert "FIR IC: fix test with behavior different from non-tight cycle variants"
This reverts commit c4a29651 as it is no longer needed after IC fix: `5ba3053e` "[IC] Do not report recompilation of non-existing files", because now fix-ic-build.log duplicates the main build.log

#KT-54991 In Progress
2023-01-30 13:45:38 +00:00
Aleksei.Cherepanov 67f308dbdb Add dummy test data
Gradle IC with enabled FIR compilation adds some extra files to the compilation scope compared to the previous compiler(KT-55576). Adding dummy files to such tests with expanded compilation scope will prevent green Aggregate build if some changes in IC will lead to full module compilation as there were such precedents with JS IC because otherwise, all files in the module are present in the build log.

#KT-54991 In Progress
2023-01-30 13:45:38 +00:00
Aleksei.Cherepanov 848e1001f8 Add test for IC issue with typealias
If typealias is defined in a separate file, then after changing some base types, an incremental compilation of Kotlin could not find all affected files, because of lack of information, which it can not get on the class file analyzing phase. FIR provides a new approach to IC compilation: now we can run the frontend several times, which allows us to obtain all necessary information and use it to mark all affected files for recompilation.
Relates to KT-54991

#KT-28233 Fixed
2023-01-30 13:45:37 +00:00
Aleksei.Cherepanov 671aa68ad6 Add K2 tests for JPS with different configuration (K2, LightTree and Fir-IC)
*Enable JPS tests for K2
*Exclude compiler messages from the comparison of output logs, as they can vary depending on the compiler
*Mute failing tests:
  1) Sam conversions - Unmute after updating IntelliJ core up to 212, as they should pass after updating IntelliJ JPS dependency
  2) Failing IC tests with Java-interop, that are needed to be fixed during KT-55696
  3) Failing IC tests with recording different sets of lookups by the compiler, that are needed to be fixed during KT-55195
  4) Failing AllConstants, will be changed in KT-54991
*Fix test data:
  1) Add cleaned outputs for JPS, because Gradle skips error messages at all
  2) Rename gradle-fir-build.log to fir-build.log, because JPS also can use it and there is no need to duplicate files
  3) Add some k2-specific logs, that changed the set of files in different rounds in comparison with the old compiler, but the scope stays the same
  4) Remove useless logs and obsolete directives.txt files as they have no impact on test results
  5) Replace fir-build.log files with gradle-fir-build.log because Gradle build with FIR is correct, but not optimal. JPS with K2 is now tested with fir-build.log files
  6) Remove useless fir-log, as it duplicates the main build log, and Remove empty directives file

#KT-54991 In Progress

Merge-request: KT-MR-8174
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-01-10 14:31:55 +00:00
Alexander Udalov 7a9c59aeb5 JVM IR: do not serialize metadata for actualized optional expectations
Optional-expectation annotations which have an actual counterpart should
have never been serialized to the kotlin_module's proto. See for example
the original (correct) implementation in the old JVM backend in
`PackageCodegenImpl.addDescriptorToOptionalAnnotationsIfNeeded`.

 #KT-55611 Fixed
2023-01-02 15:30:27 +00:00
Hung Nguyen cdbbead157 Handle changes to inline functions/property accessors with @JvmNames
If we detect a change in an inline function `foo` with @JvmName
`fooJvmName`, we have two options:
   1. Report that function `foo` has changed
   2. Report that method `fooJvmName` has changed

Similarly, if we detect a change in an inline property accessor with
JvmName `getFoo` of property `foo`, we have two options:
   1. Report that property `foo` has changed
   2. Report that property accessor `getFoo` has changed

The compiler is guaranteed to generate `LookupSymbol`s corresponding to
option 1 when referencing inline functions/property accessors, but it is
not guaranteed to generate `LookupSymbol`s corresponding to option 2.
(Currently the compiler seems to support option 2 for *inline*
functions/property accessors, but that may change.)

Therefore, we will choose option 1 as it is cleaner and safer.

^KT-54144 In progress

Small cleanup in IncrementalCompilerRunner

 - Add comment for closing caches
 - Rename providedChangedFiles to changedFiles
 - Tiny clean up in `performWorkBeforeCompilation`
 - Count directories to delete in debug logs

^KT-53015 In progress

Extract KotlinClassInfo to a separate class

to reduce the size of IncrementalJvmCache and prepare for the next
change.

^KT-54144 In progress

Ignore inline functions that are not found in the bytecode

^KT-54144 In progress

Add unit test for handling `@JvmName`s

Test: KotlinOnlyClasspathChangesComputerTest
             #testFunctionsAndPropertyAccessorsWithJvmNames
^KT-54144 Fixed

Update unit tests for handling `@JvmName`s

In a previous commit, we made a behavior change for inline property
accessors: The existing behavior is that if the implementation of an
inline getter has changed, only usages of the getter will be impacted
but not usages of the setter (and vice versa).

After that previous commit, usages of *both* the getter and setter will
now be impacted (i.e., we might compile slightly more files). This is
because a change to either the getter or the setter will now be
considered a change to the property, which will help simplify our change
analysis.

This commit updates the relevant unit tests to reflect the new behavior.

Test: Updated Incremental*TestGenerated.PureKotlin#testInlinePropertyInClass
      and Incremental*TestGenerated.PureKotlin#testInlinePropertyOnTopLevel

^KT-54144 Fixed
2022-11-10 10:03:55 +01:00
Aleksei.Cherepanov b6612c2dcb Replace the Cyrillic character "C" with the Latin version in the test data 2022-10-20 12:49:56 +02:00
Oleg Bask 3302aa5017 Rename C.kt containing cyrillic characters (#4984) 2022-10-20 12:42:28 +02:00
Aleksei.Cherepanov 0950205a47 [IC] Add test for lookups flushing
#KT-53168
2022-07-14 12:55:29 +00:00
Andrey Uskov 5ba3053e00 [IC] Do not report recompilation of non-existing files 2022-07-12 05:53:10 +00:00
Andrey Uskov deb2ef9a51 Add details about compilation rounds in IC tests 2022-07-12 05:53:09 +00:00
Andrey Uskov 318d955d64 [IC] Add tests for sealed classes (KT-45474) 2022-07-12 05:53:09 +00:00
Dmitry Gridin e5bfb8295e [jps][tests] migrate from 1.6 to 1.8 jdk
^KTIJ-20456
2022-04-26 21:41:36 +07:00
Aleksei.Cherepanov 3d8f140d6b [JPS] Fix incremental build after changing Java enum used in Kotlin when
EnumWhenTracker implemented for tracking changed java enum class items, that used in kotlin when expression.

#KT-47824 Fixed
2022-04-19 18:39:41 +00:00
Aleksei.Cherepanov bdf229bc5c [JPS] Ignore classpath from facets to exclude jars from gradle build
Reimport after `./gradlew build` adds jars from gradle's `build/libs` to facet's classpath. That causes problems with JPS build, because it doesn't see changes in out folder, but see unchanged jar, so changes don't apply.

#KT-51873 Fixed

Merge-request: KT-MR-6018
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2022-04-18 11:20:40 +00:00
Ilya Chernikov c4a29651b0 FIR IC: fix test with behavior different from non-tight cycle variants 2022-03-30 08:34:51 +00:00
Ilya Chernikov 5abdf93d3b IC: Add IC test with fix on rename file with only class inside
"fails" on JS and JPS tests - the IC logic there is less precise.
2022-03-30 08:32:17 +00:00
Ilya Chernikov aa0386276d Fix FIR incremental compilation failure with inlines and lambdas
#KT-51546 fixed
2022-03-14 13:37:50 +03:00
Aleksei.Cherepanov 76637a8844 Fix JPS test after 9e1a771d 2022-01-31 12:55:37 +03:00
Aleksei.Cherepanov 0e0b3e6d75 Add test of Kotlin Lombok project compilation
This test checks that the project with Lombok plugin will be compiled successfully after successful import (KTIJ-20506)

#KTIJ-20641 Fixed
2022-01-28 13:30:42 +00:00
Hung Nguyen 9e1a771d57 KT-44741: Update test data to use companion object with custom name
Test: Existing IncrementalJvmCompilerRunnerTestGenerated.PureKotlin#testCompanionConstantChanged
    and similar *.PureKotlin#testCompanionConstantChanged tests
2022-01-27 02:34:42 +03:00
Aleksei.Cherepanov 9971ae4ffd Revert "Fix org.jetbrains.kotlin.jps.build.KotlinJpsBuildTest#testSourcePackageLongPrefix"
This reverts commit e3634c16
2022-01-26 10:03:06 +00:00
Aleksei.Cherepanov 44d796e850 Fix JPS tests after JPS module moved to Kotlin repo
Fix testdata of new compiler tests for JPS, as it is build-log-sensitive:
ClassHierarchyAffected.testWithIntermediateBodiesChanged
PureKotlin.testSerializedSubClassAndChangedInterfaces
WithJava.JavaUsedInKotlin.testRawErrorTypeDuringSerialization

Mute JavaUsedInKotlin.SamConversions tests, as it was fixed in 212 idea

Add missed part of commit 5f4be072 [JPS] Fix JS incremental compilation
Part of commit, located in JPS module, was missed during JPS relocation

Fix test MixedInheritance for non-JPS builds
Depends on commit [CHERRY PICKED FROM IJ] [testdata] Replace test IncrementalJvmJpsTest...
2022-01-26 10:03:05 +00:00
Aleksei.Cherepanov 411a0ecc38 [CHERRY PICKED FROM IJ] [testdata] Replace test IncrementalJvmJpsTestGenerated.WithJava.JavaUsedInKotlin.testMixedInheritance with new one
Replace test because JPS recompile inherited classes only in case of existence of direct use (like override or direct call of parent methods).
Tested cases:
*Add new abstract method when derived class does not abstract
*Add and remove method, when such method is present in derived class
*Change return type/access modifier

GitOrigin-RevId: 767e58ba3d3e4069838c717666329b43f1b8e936
Original commit: https://github.com/JetBrains/intellij-community/commit/d738c61aaefe95acd8130066f53f8d8bcadfa977
2022-01-26 10:03:04 +00:00
Aleksei.Cherepanov 7181244129 [CHERRY PICKED FROM IJ] Fix test IncrementalJvmJpsTestGenerated$WithJava$Other.testMultifileClassFileAdded
Fix test data and also remove useless marking of multifiles in KotlinBuilder after 2ee7f2b "incremental annotation processing environment" as it makes the same thing and all results are ignored

GitOrigin-RevId: 379eb3f350539cb1ee27098eecb28931df73b626
Original commit: https://github.com/JetBrains/intellij-community/commit/ee2865c35c2dadc3651518b2760b5176835b251c
2022-01-12 15:25:22 +01:00
Aleksei.Cherepanov dc9abef6e5 [CHERRY PICKED FROM IJ] [testdata] Fix Jps tests testdata
Fix test IncrementalJvmJpsTestGenerated$PureKotlin.testPackageFileAdded
Fix test IncrementalJvmJpsTestGenerated$Custom.testCommonSourcesCompilerArg
Fix test IncrementalJvmJpsTestGenerated$WithJava$JavaUsedInKotlin$SamConversions.testMethodAddDefault

GitOrigin-RevId: 63b7a47898ca42b4d7f11a01ceb0e019933f528b
Original commit: https://github.com/JetBrains/intellij-community/commit/e91bfb29e65b9eb5452c4d5f544f0bbfa3eafde3
2022-01-12 15:25:21 +01:00
Aleksei.Cherepanov 2ea089f0d2 [CHERRY PICKED FROM IJ] Fix incremental build after changing Java const used as class property
Report Java static final constant with InlineConstantTracker, used as class property in Kotlin for further registration in JPS. Add tests.

#KT-49177 Fixed

GitOrigin-RevId: 01a58cf10f5419d70f0d80cbaa9bcd9732ff0547
Original commit: https://github.com/JetBrains/intellij-community/commit/d077f3b3217c8d88518fec7249228cb29df2e0ff
2022-01-12 15:25:20 +01:00
Stanislav Erokhin 3b6cdb071f [CHERRY PICKED FROM IJ] [testdata] Fix testdata for IncrementalJvmJpsTestGenerated.WithJava.JavaUsedInKotlin#testConstantChanged
Previously, because the package in java file was used, generated test runner file was incorrect

GitOrigin-RevId: 3fcf599a26a0789154c550e6ac4aafe0829ce0d1
Original commit: https://github.com/JetBrains/intellij-community/commit/cbe50ad2423fbdb6e18541ecb040bdb0c67af7fd
2022-01-12 15:25:20 +01:00
Aleksei.Cherepanov 6c7a6bf3b1 [CHERRY PICKED FROM IJ] Simplify API for InlineConstTracker and add testdata
GitOrigin-RevId: b2bcde9e3102d575ca459f475c00022515b6ccba
Original commit: https://github.com/JetBrains/intellij-community/commit/f78e98d1ba5b6c142076b67f88c54282c3964c7f
2022-01-12 15:25:20 +01:00
Aleksei.Cherepanov 40dc548fec [CHERRY PICKED FROM IJ] [JPS] Fix incremental build after changing Java constant
InlineConstantTracker implemented for tracking changed java static final constants, that used in kotlin.

#KT-46506 Fixed

GitOrigin-RevId: 63830580acb09d31fe0deede9f82bc1a2847443d
Original commit: https://github.com/JetBrains/intellij-community/commit/3736c00c2c8757241e6fd217faef733421eb9e80
2022-01-12 15:25:19 +01:00
Nikita Bobko fddb205e16 KotlinJpsBuildTest#testJre9: migrate to JDK 11
Possibility to use JDK 9 was dropped in the Kotlin repo in
this commit de7fb9606a so I had to migrate this test.

Consulted with @udalov. He said that it's fine to migrate this test to JDK 11
2022-01-12 15:25:18 +01:00
Nikita Bobko e3634c1635 Fix org.jetbrains.kotlin.jps.build.KotlinJpsBuildTest#testSourcePackageLongPrefix
The test started failing after cherry-picking it from intellij repo
(in intellij repo it was passing without this commit)
2022-01-12 15:25:12 +01:00
Nikita Bobko 8d2755db4f Fix KotlinModuleXmlGeneratorTest
modules.xml testData was renamed from idea/testData/modules.xml/
2022-01-12 15:25:11 +01:00
Mikhail Zarechenskiy 8b2f4d1ef0 [CHERRY PICKED FROM IJ] [kotlin] update testdata for incremental jps tests
Since Kotlin 1.5 SAM conversion are working via invokedynamic

GitOrigin-RevId: a6ba80fe559619f79ce1caf4e04e0cdeb1f2487a
Original commit: https://github.com/JetBrains/intellij-community/commit/846889f31c982dd3015b585309c36d05c29e98b6
2022-01-12 15:10:57 +01:00
Mikhail Zarechenskiy 3cf5d218a2 [CHERRY PICKED FROM IJ] [kotlin] misc: update testdata after switching to 1.5
GitOrigin-RevId: 3901d27f26b349b4fbf40d50bad6a37f06c1182e
Original commit: https://github.com/JetBrains/intellij-community/commit/974ddc03c2228a1135ff84658c04424a72684d2e
2022-01-12 15:10:57 +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 bb0b785c59 [CHERRY PICKED FROM IJ] KotlinJpsBuildTest: fix tests
GitOrigin-RevId: 51f9595dfb5f0ba280bab935e5945384dfe7e487
Original commit: https://github.com/JetBrains/intellij-community/commit/18bf77b87f8b89f6a6827176ce61215f2a69f0c4
2022-01-12 15:10:47 +01:00
Nikita Bobko 3033cf0a03 [CHERRY PICKED FROM IJ] kotlin-ide migration: Normalization commit
This commit is consequence of not accurate migration to kotlin-ide repo.
These changes appeared as a result of split of big chunk of first
commits in kotlin-ide repo. I don't know where from changes in this
commit come from.

It could be changes of "bunch switch" commit. Or changes of other
accidentally squashed commits

GitOrigin-RevId: 6d1e18c36e02a4ad228fe7ddc5bd056e98e1be36
Original commit: https://github.com/JetBrains/intellij-community/commit/c490f5864de6ef36964aa4ee34cdf7b3f35db384
2022-01-12 15:10:43 +01:00
Nikita Bobko 5d91e54f41 Merge Kotlin JPS plugin
Kotlin JPS plugin existed in Kotlin repo before but was migrated to
intellij-community together with entire Kotlin plugin.
Now I return Kotlin JPS plugin back because it turned out that it's
easier to develop JPS in KT release cycle. Also I need to
unbundle Kotlin JPS plugin in scope of KTIJ-11633
2022-01-12 15:10:21 +01:00
Nikita Bobko db7472a376 Rename: jps-plugin -> jps/jps-plugin 2022-01-12 15:09:45 +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
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 442f384321 [IC KLIB] Replace JS IR build log with KLIB build log for klib compialtion
- fix test data

Original commit: 350ff8033d
2021-01-26 19:23:25 +03:00
Roman Artemev fccfdabfc4 [IC TEST] Fix IC multi module tests for gradle
Original commit: b4ed7110dd
2021-01-26 19:23:24 +03:00