Commit Graph

108990 Commits

Author SHA1 Message Date
Dmitriy Novozhilov d1e7b9b4cf [Test] Add Fir Identical checkers for signature dump handler 2024-02-19 13:59:48 +00:00
Dmitriy Novozhilov e3dc0f0fa3 [Test] Register some identical checkers for specific handlers
- `FirIrDumpIdenticalChecker` for
    - `IrTextDumpHandler`
    - `IrPrettyKotlinDumpHandler`
- `FirIrSourceRangesIdenticalChecker` for
    - `IrSourceRangesDumpHandler`
- `FirIdenticalChecker` for
    - `FirDiagnosticsHandler`
2024-02-19 13:59:48 +00:00
Dmitriy Novozhilov ad27d04e68 [Test] Add an ability for AnalysisHandler automatically register AfterAnalysisCheckers
This is needed for cases like dump handlers to register corresponding
  checkers, which compares identity of dumps for different configurations,
  like `IrTextDumpHandler` and `FirIrDumpIdenticalChecker`
2024-02-19 13:59:48 +00:00
Alexander Shabalin 60bf15d654 [K/N][tests] all users of nativeTest() require executors 2024-02-19 13:53:05 +00:00
Vladimir Dolzhenko 60b4ce2c36 Fix flakiness of createByPattern results
Fix the order of pointers and place logical operators first

#KTIJ-28165 Fixed


Merge-request: KT-MR-14447
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2024-02-19 12:16:09 +00:00
Anton Bannykh 302e38dd18 JS: enable test after bootstrap
Check that a custom Promise declaration is supported for the @AfterTest
annotation functionality in the kotlin.test library

This is a part of the fix for KT-63359


Merge-request: KT-MR-14333
Merged-by: Anton Bannykh <Anton.Bannykh@jetbrains.com>
2024-02-19 11:56:18 +00:00
Alexander Udalov 90ff8f0e64 JVM: support -Xjdk-release=7/1.7
#KT-59098 Fixed
2024-02-19 11:44:58 +00:00
Alexander Udalov 12f393791b JVM: allow -jvm-target 1.8 with -Xjdk-release=1.6
#KT-59098
2024-02-19 11:44:58 +00:00
Alexander Udalov 1bc08fc5b8 JVM: report error on -Xjdk-release=6 without -jvm-target
#KT-59098
2024-02-19 11:44:58 +00:00
Alexander Udalov cdcb65c749 Tests: minor, slightly move JDK path substitution logic
It will be used in other CLI tests in subsequent commits.
2024-02-19 11:44:58 +00:00
Andrey Yastrebov 60071cbb54 KT-65740 Create swift-export-embeddable module 2024-02-19 10:55:55 +00:00
Anton Lakotka bd84f93333 [Gradle, Test] makeSnapshotTo should fail when called in TC env
Developers (me) often forget to remove calls to this debugging
utility. Usually this changes is visible during Code Review but we
shouldn't rely on a sharp eye of a human. It is better to automatically
check it during remote run execution.
2024-02-19 10:42:46 +00:00
Anton Lakotka cd8843289b [Gradle, Test] Make utility isTeamCityRun as top-level function 2024-02-19 10:42:46 +00:00
Artem Kobzar 0d2c68664d [JS Plain Objects] Add README to the compiler plugin 2024-02-19 10:32:16 +00:00
Ilya Goncharov abb5f55087 [Wasm] Use static import for wasm imports
^KT-65777 fixed
2024-02-19 10:01:10 +00:00
Dmitrii Gridin 68e5fc7344 [LL FIR] LLFirLazyResolver: drop LLFirLockProvider parameter
It can be inferred from `LLFirResolveTarget` inside
`LLFirTargetResolver`
2024-02-19 09:41:22 +00:00
Dmitrii Gridin efeffb45b7 [LL FIR] LLFirLazyResolver: drop ScopeSession parameter
It can be inferred from `LLFirResolveTarget` inside
`LLFirTargetResolver`
2024-02-19 09:41:22 +00:00
Dmitrii Gridin 7d672cd474 [LL FIR] drop ScopeSession parameter from LLFirModuleLazyDeclarationResolver
This parameter was required for on-air analysis
to avoid garbage in the original scope session.
Now we can drop it, and it will be less error-prone
2024-02-19 09:41:22 +00:00
Dmitrii Gridin 80b698ce32 [FIR] drop obsolete FirResolveContextCollector
This interface is unused
2024-02-19 09:41:22 +00:00
Dmitrii Gridin 2e17d8d524 [LL FIR] FileStructureElementDiagnosticRetriever: deduplicate code 2024-02-19 09:41:22 +00:00
Dmitrii Gridin 3f31bdb877 [LL FIR] merge DeclarationBaseStructureElement into FileStructureElement
To simplify the implementation
2024-02-19 09:41:22 +00:00
Dmitrii Gridin a9f7c153d2 [LL FIR] rename LLFirResolveMultiDesignationCollector to LLFirResolveDesignationCollector
As it is not "multi" after 77c850f0d0
2024-02-19 09:41:22 +00:00
Dmitrii Gridin 0ecb174720 [LL FIR] LLFirLazyResolver: deduplicate code 2024-02-19 09:41:22 +00:00
Dmitrii Gridin 84f3cc9f9c [Analysis API] drop obsolete code 2024-02-19 09:38:18 +00:00
Dmitriy Dolovov 1c3633c9f2 [Native][tests] Use new KLIB tool entry point for running tests
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 215303606b [KLIB tool] Entry point for tests: org.jetbrains.kotlin.cli.klib.Main.exec
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 16a27c2e05 [KLIB tool] Split KlibToolCommand into multiple individual commands
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 358ad272f4 [KLIB tool] Extract class KlibToolCommand from main.kt
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 9878c1fa16 [KLIB tool] Introduce KlibToolOutput for capturing stdout and errors/warnings
With `KlibToolOutput` it's possible to forward the output of each
KLIB tool's command to either system stdout/stderr streams or to
some buffers which then can be read by tests.

^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 5b7c11ae39 [KLIB tool] Introduce a '-test-mode' CLI option
This is an option that allows running the commands that support it
in a special "test mode". The "test mode" means (but not limited to)
that a command may, for example, sort the output which is unsorted
by default, and this way guarantee stable output. This is essentially
helpful for tests, which rely on the command output.

^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 82115c1f26 [KLIB tool] Drop unused blind flag in "remove" command
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 77b574bd0d [KLIB tool] Rename class Library -> class KlibToolCommand
Also, make it use `KlibToolArguments` instead of separate isolated
arguments passed via constructor or via individual command calls.

^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 7aa106c3a0 [KLIB tool] Extract self-sufficient classes from main.kt to separate files
Classes extracted:
- KlibToolArguments
- KlibToolArgumentsParser
- KlibToolLogger
- KlibToolIrLinker

^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 4fe8885376 [KLIB tool] Split KlibToolArguments to arguments & arguments parser
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 02ab472f0b [KLIB tool] Rename: class Command -> class KlibToolArguments
This way it would better reflect its purpose.

^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 921a787815 [KLIB tool] Move all CLI-related logic to the Command class
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov d4585ff3ce [KLIB tool] Refactoring. Fix visibility, add comments, drop useless code
What's done:
- Reduce the visibility of all entities inside the module to `internal`
  or `private`. Only leave `fun main()` as `public` because it's the
  single legal entry point.
- Add comments to few classes related to "contents" command that they
  should be removed together with the command after 2.0.
- Drop useless `DeclarationHeaderRenderer` interface.
- Rename: KlibToolLinker -> KlibToolIrLinker

^KT-62340
2024-02-19 09:36:10 +00:00
Anastasia.Nekrasova fd4f6c90c7 [K/N][K2] K2 behavioral difference with inconsistent inheritance of ObjCName
Support for complex cases with multiple substitution overrides.

#KT-64276 Fixed
2024-02-19 09:29:43 +00:00
Anastasia.Nekrasova d69240a2d5 [FIR] Fixed behavior of FirAnnotation.findArgumentByName for resolved annotations
The 'findArgumentByName' function was returning an invalid result for
annotation arguments with omitted argument name.

#KT-64276
2024-02-19 09:29:43 +00:00
Anastasia.Nekrasova bb8c7dd04c [K/N][K2] K2 behavioral difference with inconsistent inheritance of ObjCName
When a declaration with an ObjC annotation is stored in a different
module, the annotation arguments are not resolved by default. This leads
to a bug in the checker. Before attempting to find the objCName, it is
necessary to resolve the annotation first.

#KT-64276
2024-02-19 09:29:43 +00:00
Timofey Solonin 700432e111 Add a closure function to return a graph in explicit bfs order
^KT-65540
2024-02-19 09:28:08 +00:00
Ilya Goncharov 87fdf8e764 [Gradle, Wasm] Binaryen by default for production main binary
^KT-64553 fixed
2024-02-19 09:06:44 +00:00
vladislav.grechko 3dda88ddc2 [FIR] Handle FirErrorExpression when resolving arguments
^KT-65787: Fixed
2024-02-19 08:50:59 +00:00
Anton Lakotka 7a150cce47 [Gradle] Introduce defaultFragmentName for K2 MPP Structure
It is possible to add source files to task directly. Especially this is
a very popular case for Android integration. Android variants can
contain any number of extra-source files that should be compiled
together with other android-specific sources.
Android specific sources that come from Android source sets already
compiled together as part of "main" fragment (KT-62508).
With this change this logic is extended to any extra sources
that are added directly to the compile task.

^KT-62508 Verification Pending
2024-02-18 16:42:19 +00:00
Anton Lakotka 020bb72d2b [Gradle] Associate Android java sources with related Kotlin Source Set
Java sources can be produced by the task or can be configured with
task dependencies. Previously sources were included into task directly
now they are properly configured with Kotlin Android Source Set.

^KT-63753 Verification Pending
^KT-65426 Verification Pending
2024-02-18 16:42:19 +00:00
Anton Lakotka b5ed2326e7 [Gradle] Merge Android Source Sets into one K2 Fragment
Android projects has a number of build type/flavor specific source set.
These source sets are included into compilation of multiple variants.
In Android compilation model they should be compiled together and they
should see each-others declarations. With Kotlin MPP plugin applied
these android source sets gets associated with Kotlin Source Sets
counter parts. However in Kotlin Multiplatform Source sets have
a semantics about "expect/actual" refinement and with K2 it also got
stricter and visibility is checked. This is not compatible with Android
compilation model thus the solution is to merge Android Source Sets
into one K2 Fragment.

^KT-62508 Verification Pending
2024-02-18 16:42:19 +00:00
Anton Lakotka 0a86f03457 [Gradle] Don't pass -Xfragment-sources for non-mpp compilations
It is unnecessary and confusing.

^KT-65768 Verification Pending
2024-02-18 16:42:19 +00:00
Anton Lakotka fabf75f4e2 [Gradle] Pass Android-related sources to KotlinSourceSet instead task
Setting sources through compile task is not compatible with
Multiplatform K2 because for such sources no K2 Fragment relations
will be set and compilation will fail.

^KT-63753 Verification Pending
2024-02-18 16:42:19 +00:00
Anton Lakotka b13b27a715 [Gradle] Migrate new-mpp-android from Groovy to Kotlin Script 2024-02-18 16:42:19 +00:00
Pavel Mikhailovskii 20bb6b0ea8 [KAPT] KT-64391 Make sure that all K2 KAPT tests really run with K2
Merge-request: KT-MR-14346
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
2024-02-16 19:27:46 +00:00