Commit Graph

148 Commits

Author SHA1 Message Date
Nikita Nazarov 407448d8e3 [JVM] Implement new inlined variable naming format
^KT-65478 fixed
2024-02-23 23:59:13 +01:00
Dmitrii Gridin 072d191306 [compiler] replace Enum values() with entries
To fix warnings. Also, use of `Enum.entries` may improve the performance

^KT-48872
2024-02-20 17:56:46 +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
Pavel Kunyavskiy 5ddc31e932 [Tests] Add handler to regenerate irText testData
It is disabled by default, can be enabled by code change.
It's useful when changes in dumper is done with significant
amount of tests changed.

^KT-65460
2024-02-16 10:19:37 +00:00
Alexander Udalov 9d5e1bdc47 CLI: remove obsolete -Xallow-result-return-type 2024-02-01 23:37:23 +00:00
Dmitriy Novozhilov cb3f41f669 [Test] Don't override manually registered services during test configuration
There are two ways of test service registration:
- manual call to `useAdditionalServices` in abstract test runner
- using of `additionalServices` property in one of test entity (e.g. in handler)

Services are registered in the same order (manual first, automatic second)

This led to the situation that if there was registered more specific
  implementation of the service in the test configuration, it will be
  overridden with regular implementation from handler, which is fixed
  by this commit
2024-01-24 10:45:00 +02:00
Sergej Jaskiewicz e8aa05928d [FIR2IR] Unconditionally disable linkViaSignatures on JVM
It was an experimental compilation mode that we don't need anymore.

KT-64809
2024-01-19 13:35:59 +00:00
Vladimir Sukharev 08bc0a6bd0 [K/N] Adjust moved special backend checks tests
^KT-61564
2024-01-09 14:17:47 +00:00
Jinseong Jeon 3c775c4a42 Fix dependency kind explanations
They are directly used for enum valueOf, and the enum constants are not
all capitals. Instead, only the first letter is capital.
2023-12-19 07:03:28 +00:00
Sergej Jaskiewicz f844a86057 [utils] Introduce the bind function and use it throughout 2023-12-13 10:04:45 +00:00
Dmitriy Novozhilov 039baf95fc [Test] Add empty platform module for MPP diagnostic test with only one module
After previous commits IrActualizer runs only there are at least two modules
  in backend input. So to check diagnostics from Actualizer all tests
  should contain at least two modules

Diagnostics in test `extendExpectedClassWithAbstractMember.kt` were
  changed because there is an exception from IrActualizer caused by
  errors from frontend (`ABSTRACT_METHOD_NOT_IMPLEMENTED`), which is
  swallowed by this kind of tests
2023-11-27 10:17:54 +00:00
Leonid Startsev 4fa121071a Update kotlinx-serialization dependency for serialization compiler plugin tests.
Properly set up dom-api-compat dependency for JS IR tests. Since this dependency is added
automatically for every Kotlin/JS library, it should be present during tests just as stdlib.

As a result, tests for serializable enums were changed since 1.6.0 runtime does not require enums to be explicitly serializable.
2023-11-10 14:14:04 +00:00
Dmitrii Gridin 052b9f01af [tests] TestRunner: wrap exceptions from preAnalysisHandlers
Some exceptions (like contract violations) can be thrown from preAnalysisHandlers
2023-10-24 10:30:55 +00:00
Dmitriy Novozhilov 9e66a7b999 Workaround KT-62473 in the codebase 2023-10-18 07:59:27 +00:00
Dmitrii Gridin 2cac922cd0 [FIR] add tests on external annotations
Tests are excluded in COMPILED_JAVA mode because in this
mode external annotations are not present at all

^KT-62310
2023-10-13 12:16:12 +00:00
Mikhail Glukhikh 556f3ee8d5 K2: use LATEST_STABLE in compiler tests instead of explicit 2.0 2023-09-19 15:46:29 +00:00
Nikita Bobko 01fc708a0f Mark expect/actual classifiers as experimental
^KT-61573 Fixed
Review: https://jetbrains.team/p/kt/reviews/11969/timeline

Tests:
- MultiPlatformIntegrationTestGenerated
- CliTestGenerated
- MultiPlatformIntegrationTestGenerated
- DiagnosticTestGenerated.Multiplatform
- FirLightTreeOldFrontendDiagnosticsTestGenerated

Also add -Xexpect-actual-classes flag to all necessary ./libraries/* modules
Otherwise compilation of those modules failes because of `-Werror`
2023-09-04 12:21:37 +00:00
Kirill Rakhman 969c716c76 [FIR] Implement flag for disabling warning on error suppression
#KT-61129
2023-08-18 13:29:20 +00:00
Sergej Jaskiewicz 2727163a63 [test] Introduce DeserializedIrBackend backend kind
We have `BackendKinds.IrBackend` for IR emitted by the frontend.

We need a different backend kind for IR deserialized from klibs.

We cannot use `BackendKinds.IrBackend` for that purpose, because we
cannot have two different `IrBackendInput` subclasses with the same
kind.

We need a different `IrBackendInput` subclass for deserialized IR
because the `IrBackendInput` for frontend-emitted IR contains some
properties like `sourceFiles` which don't make sense for
deserialized IR.

Since we now have two backend kinds for IR artifacts, we need to make
certain functions and classes in the test infrastructure generic
over backend kinds.

Note: the JsIrDeserializedFromKlibBackendInput class is not used
anywhere yet. We will use it in the coming commits.
2023-07-28 11:19:21 +00:00
Ivan Kylchik 3c9eb87c8d [Test] Reuse buildFir... methods from firUtils.kt 2023-07-27 22:50:21 +00:00
Svyatoslav Kuzmich b503eafcb2 [Wasm] Allow implementing function interfaces in the new test infra
Make it consistent with CLI and old test infra
2023-06-25 10:18:50 +02:00
Svyatoslav Kuzmich 736519c506 [JS] Rename JsLibraryProvider to LibraryProvider
This class is not JS-specific and can be used in Wasm test services
2023-06-25 10:18:50 +02:00
Kirill Rakhman 919d6401f7 [Tests] Convert line endings of test files to LF
This fixes a problem on Windows where CRs would end up in the code
leading to parsing problems.
2023-06-23 09:03:28 +00:00
Nikolay Lunyak 46ea908daf [Tests] Ensure the temporary directories are cleared
This change may prevent OOMs. Context:
https://jetbrains.slack.com/archives/C4U955N6B/p1685000899030279
2023-06-20 13:28:23 +00:00
Nikolay Lunyak 70605c84df [FIR Native] KT-58549: Get rid of the builtin provider
According to
`FirNativeCodegenBoxTestGenerated.testNestedClassesInAnnotations`,
the annotation
`kotlin.internal.PlatformDependent` is
unresolved reference.

^KT-58549 Fixed
2023-06-01 10:27:54 +00:00
Ilya Goncharov bcefa1cd66 [Gradle, Wasm] Add wasm platform kind
KTIJ-25583
2023-05-17 13:28:20 +00:00
Mads Ager 6117f76a8c Discourage the use of LANGUAGE_VERSION directive.
Pinning the language version is rarely the right thing to do.
This changes makes it harder to do so by requiring an additional
directive with a name that indicates to developers that they are
likely doing something dangerous.
2023-05-15 14:29:48 +00:00
Mads Ager fb476612af Add LANGUAGE_VERSION test directive. 2023-05-12 10:49:42 +00:00
Pavel Mikhailovskii 7ac5233a32 KT-54804 [SLC] Generate synthetic functions for annotations on properties in light classes 2023-05-12 09:39:37 +00:00
Kirill Rakhman 3c66ae0f8b [FIR, LT] Report syntax error by traversing LT after parsing
#KT-57756 Fixed
2023-05-05 09:34:24 +00:00
Kirill Rakhman 6119606cb6 [FIR LT] Make syntax error reporting in tests consistent with cli 2023-05-05 09:34:23 +00:00
Roman Golyshev d4cffb8a5a [213] Switch to 213 platform
KTI-1114
2023-04-21 13:19:04 +00:00
Dmitriy Novozhilov 6287968511 [FIR Test] Migrate AbstractFirLoadCompiledKotlin to new test infrastructure
Also introduce two different modes for those tests:
- load metadata compiled with K1
- load metadata compiled with K2
2023-04-19 14:33:25 +00:00
Ivan Kylchik 86b3ec73d1 Add new set of tests to run JVM checks with IR inliner 2023-03-14 20:47:42 +00:00
Mikhail Glukhikh fbea09b3b6 K2 tests: always use language version 2.0 or higher 2023-03-11 10:15:24 +00:00
Ilya Kirillov dec9bdefb6 [FIR] continue executing the test pipeline in a case of FirLazyResolveContractViolationException is thrown
Previously in the black-box test, no actual tests were run in a case FirLazyResolveContractViolationException were thrown
2023-02-24 16:10:58 +01:00
Dmitrii Gridin 3b9318bd3a [SLC] LazyAnnotationsBox: drop redundant synchronization
We can use less strict rule for produced annotations:
* Previously: the same annotations from `findAnnotation` and `annotations`
have the same identity
* Now: the same annotations from `findAnnotation` and `annotations`
are equals by 'equals'

^KT-56046
2023-02-03 19:49:03 +00:00
Svyatoslav Kuzmich bebb9b1392 [Wasm] Move compiler tests to :wasm:wasm.tests module
They don't belong in K/JS test module.
2023-01-31 13:12:12 +00:00
Ilya Kirillov a55b4a977b [FIR] refactoring: extract registration of lazy declaration resolve contract checking to a separate function in tests 2023-01-13 15:57:05 +00:00
Sergej Jaskiewicz 672be7ecb5 [test] Allow files with same names in tests
Introduce a directive that allows compiling different files with
matching names in tests.
2022-12-01 17:15:55 +00:00
Jaebaek Seo 1a5a6474d6 Support TargetPlatform.isJs() for FIR 2022-11-15 16:50:17 +01:00
Ilya Chernikov fa0cda6236 FIR JS: enable full JS box tests with FIR 2022-11-12 14:34:07 +01:00
Dmitriy Novozhilov 097a86deb5 [Test] Check that FIR tree does not contain stub types and type variable types after resolution 2022-11-03 08:30:08 +00:00
Mikhail Glukhikh 036f9affd8 K2: link via signatures if -Xlink-via-signatures is set
Related to KT-53505
2022-09-14 10:15:22 +00:00
Pavel Mikhailovskii 6a14400342 KT-53804 Restore old and incorrect logic of generating InnerClasses attributes for kotlin-stdlib 2022-09-05 14:02:52 +00:00
Alexander Udalov 690322b203 Add flag -Xno-new-java-annotation-targets
Do not generate TYPE_USE/TYPE_PARAMETER Java annotation targets when
this flag is specified.

 #KT-53712 Fixed
2022-08-29 13:43:49 +02:00
Nikita Bobko 8f79e833a8 Drop all redundant kotlin-reflect, kotlin-reflect-api dependencies
Review: https://jetbrains.team/p/kt/reviews/6753

All redundant I managed to find, of course.

Why: I'm going to process all reflect dependencies in the next commits.
Cleanup reflect dependency before processing.

They are redundant because:
1. if `compileOnly` then compilation didn't break after dropping the
   dependency
2. if `test*` then tests didn't break after dropping the dependency.
3. `analysis/analysis-api-fir/analysis-api-fir-generator/build.gradle.kts`
   `compiler/fir/checkers/checkers-component-generator/build.gradle.kts`
   Drop `implementation(project(":kotlin-reflect-api"))` because the
   module already depends on
   `implementation(project(":kotlin-reflect"))`
4. `compiler/daemon/daemon-client/build.gradle.kts`. Drop `runtimeOnly`
   because after dropping `compileOnly` compilation didn't break (so
   `runtimeOnly` looks suspicious). Less safe than 1-3
2022-08-22 15:42:57 +02:00
Ilya Kirillov 56e6d5d6b9 [Analysis API] do not preresolve all FirDeclarations to TYPES in tests
Previously, we resolved all declaration to the TYPES phase to collect their sealed inheritors
and thus not really checking lazy resolution to TYPES.
Now sealed class inheritors collection happens in separate LLFirResolveSession
2022-08-10 22:49:13 +02:00
Victor Petukhov 8500ee08a8 [FE 1.0] Remove CONSTRAINT_SYSTEM_FOR_OVERLOAD_RESOLUTION analysis flag
The constraint system for the old type inference is going to be removed.
Also, `CONSTRAINT_SYSTEM_FOR_OVERLOAD_RESOLUTION` isn't used in the production
2022-08-02 10:29:38 +00:00
Dmitriy Novozhilov 9c41e75802 [KAPT] Migrate kapt tests to new test infrastructure 2022-07-20 10:12:24 +00:00