Commit Graph

120 Commits

Author SHA1 Message Date
Ivan Kylchik 17e49fce75 [JVM_IR] Support basic fake var generation for IR inliner
#KT-58778
2023-07-20 09:01:42 +00:00
Alexander Udalov 1e9979a6b7 Tests: rename FirPsi{Old,}DiagnosticsTestWithJvmIrBackendGenerated 2023-07-17 16:55:24 +00:00
Alexander Udalov 8fc6c03e16 Tests: merge firTestWithJvmBackend into testsWithJvmBackend 2023-07-17 16:55:24 +00:00
Alexander Udalov eeef70b2c8 Tests: remove TargetBackend.JVM_OLD
TargetBackend.JVM is equivalent to it at this point.
2023-07-17 16:55:24 +00:00
Alexander Udalov 18be8f50c0 Remove old JVM backend diagnostic tests 2023-07-17 16:55:24 +00:00
Ilya Chernikov 5824b9c59c K2 Scripting: add Fir script codegen tests
27 failing tests are muted
2023-07-05 19:46:03 +00:00
Alexander Udalov cab53361f3 Use JVM IR backend in light analysis mode tests
Add some more filters on private/synthetic stuff (which doesn't matter
in practice) to make full and light analysis mode dumps as similar as
possible, so that all existing tests will pass for JVM IR. Unmute some
tests which were failing with the old JVM backend.

Tests on repeatable annotations are muted because in full analysis,
annotations are wrapped into the container (e.g. `@A(1) @A(2)` ->
`@A$Container(A(1), A(2))`), but they are no in the light analysis mode.
So there's always going to be a difference for these tests between full
and light analysis, unless we're going to change behavior of kapt, which
would be a kind of a breaking change.

 #KT-58497 Fixed
2023-06-22 17:10:51 +02:00
Dmitriy Novozhilov 2290a096d1 [Test] Add JVM platform to name of ..FirLoadCompiledKotlin.. tests
This is needed for further distinguishing them with similar JS tests
2023-06-07 10:58:01 +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
Denis.Zharkov 67d51eb7ee Add a separate test configurations for JDK 21 dependent test
After it's released, there would be no need in them, but right now
they are unavailable through the toolchain, so we can't require it.
See KT-58765 for tracking

But there should be a dedicated Build configuration with JDK_21_0 env
properly set.

^KT-58716 Fixed
2023-05-22 09:19:52 +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
Alexander Udalov d3be38476a Merge K2 box tests to main box tests 2023-03-27 10:32:19 +00:00
Alexander Udalov 14c2030595 Merge K2 bytecodeListing tests to main bytecodeListing tests 2023-03-27 10:32:17 +00:00
Sergej Jaskiewicz 88b7f30867 [test] Use custom ignore directive for AbstractKlibJsTextTestCase tests
We've muted some irText tests on JS in the previous commits because
test expectations in some tests are different when targeting JS.

AbstractKlibJsTextTestCase tests use a different logic:
they compare the dump of the deserialized IR with the frontend-generated
IR, not with the expectations in text files, thus muted tests weren't
actually failing.

Here we introduce a temporary fix, namely
a separate // IGNORE directive for klib tests.

When klib tests are moved to the new test infrastructure, there will be
no need to do this.
2023-03-22 15:18:17 +00:00
Sergej Jaskiewicz 27ccef868a [test] Run irText tests against K1 frontend for JS 2023-03-22 15:18:17 +00:00
Sergej Jaskiewicz 17a8fd2c0b [test] Move irJsText tests to irText directory
So that all irText tests could be found in one place
2023-03-22 15:18:15 +00:00
Sergej Jaskiewicz ebafdd3af0 [test] Move irText tests from fir2ir/testData to compiler/testData
Let's store them conveniently in one place!
2023-03-22 15:18:15 +00:00
Sergej Jaskiewicz c1ea3e7b53 [test] Give IrText test classes more descriptive names
The names now reflect the frontend and the backend used to run the tests
2023-03-22 15:18:15 +00:00
Dmitrii Gridin a5e5e093c3 [LL FIR] pass correct phase to AbstractLazyBodyIsNotTouchedTest test
We have lazy expressions on ARGUMENTS_OF_ANNOTATIONS,
so we should decrease the phase to it

^KT-56543
2023-03-22 14:08:39 +01:00
Ilya Chernikov 59b88f33b2 [K2, MPP] implement IR errors reporting and test infrastructure
Fix test data

^KT-56344 Fixed
2023-03-22 01:28:16 +00:00
Mads Ager a525983e38 [JVM IR] Use error types in KAPT mode for unresolved delegate types.
^KT-57388 Fixed
2023-03-21 22:09:14 +01:00
Alexander Udalov f0fba7be64 K2: add bytecode listing tests
#KT-57171 Fixed
2023-03-14 21:57:26 +01:00
Ivan Kylchik 86b3ec73d1 Add new set of tests to run JVM checks with IR inliner 2023-03-14 20:47:42 +00:00
Dmitriy Novozhilov da581f38e1 [Test] Require specifying parser for FIR test. Unify names for FIR tests
Now all tests with `Fir` in name are named accordingly to parser which
  is used in them -- `FirPsi` or `FirLightTree`. This is needed to keep
  consistency between different types of tests, because there is no
  single default in parser mode between different scenarios of using FIR
2023-02-24 11:15:26 +00:00
Dmitriy Novozhilov a7f62581a2 [FIR] Generate PSI and LT versions of all codegen tests
Also change default mode for codegen tests from PSI to LT
2023-02-20 08:40:30 +00:00
Dmitriy Novozhilov 77caa31640 [CLI] Add CLI arguments to pass HMPP module structure to the compiler
^KT-56209
2023-02-17 11:08:50 +00:00
Ivan Kylchik bc21753877 Move IR interpreter's tests from ir/loweredIr directory into box 2023-01-27 10:52:56 +00:00
Ivan Kylchik 7d6bac64fb Extract JVM logic of AbstractIrInterpreterTest into separate class 2023-01-27 10:52:54 +00:00
Marco Pennekamp 88ac5727cc [LL FIR] KT-50732 Add support for LL FIR-specific tests (.ll.kt)
- `.ll.kt` test data can be added in cases where LL FIR resolution
  legally diverges from K2 compiler results.
- Each `.ll.kt` test is prefixed with an `LL_FIR_DIVERGENCE` directive
  which must explain why the test may diverge from K2 compiler results.
  - `LLFirDivergenceCommentChecker` ensures that each `.ll.kt` file
    contains an `LL_FIR_DIVERGENCE` directive.
- `LLFirIdenticalChecker` results in an assertion error if the `.ll.kt`
  test and its base test are completely identical, including in their
  meta info (but ignoring `LL_FIR_DIVERGENCE`).
  - The checker additionally ensures that the base source file and the
    `.ll.kt` source file have identical Kotlin source code (ignoring
    meta info and `LL_FIR_DIVERGENCE`). This ensures that both tests
    test the exact same thing.
- `.ll.kt` files are ignored by select test generators, in addition to
  `.fir.kt` files.
2023-01-16 15:20:50 +00:00
Nikolay Lunyak 5ae9444745 [FIR JS] Add a test runner for FIR JS with old diagnostic tests 2023-01-09 08:57:07 +00:00
Dmitrii Gridin 742c3de112 [LC] rename lightClasses/lightClasses to lightClasses/lightClassByFqName 2023-01-02 15:05:37 +00:00
Dmitrii Gridin eb3ad7e6b1 [LC] move light class related tests to one directory 2023-01-02 15:05:36 +00:00
Ilya Chernikov 07af2d807a Scripting, tests: enable custom script tests with IR 2022-12-11 09:08:54 +00:00
Ilya Chernikov 47448d779c K2 Scripting: enable script diagnostic tests for FIR
also add script scopes test
2022-11-26 18:01:49 +00:00
Mikhail Glukhikh 69c883ecee FIR: use FIR_IDENTICAL instead of FIR_IGNORE for diags with BE tests 2022-10-17 12:46:25 +00:00
Mikhail Glukhikh 1826d9b332 K2: add & fix tests for JVM BE diagnostics 2022-10-17 12:46:24 +00:00
Alexander Udalov abaffeddab Remove LocalClassProtoTestGenerated, replace with kotlinp tests
This test uses a hacky mode of the compiler which is not worth it to
support further (especially in K2), `USE_SINGLE_MODULE`, where
everything is compiled in one module. The purpose of the test is just to
check that metadata for local/anonymous classes is written correctly.
So we can replace it with the tests on kotlinp, which uses
kotlinx-metadata-jvm and dumps all loaded metadata to text.

This replacement is not perfect, in particular because it won't check
that the reflection machinery is able to load this metadata, and because
it won't check that annotations are loaded correctly from the bytecode.
But IMHO it's good enough, there are box tests on reflection on local
classes (e.g. `reflection/annotations/localClassLiteral.kt`), so this
way is better than having to support the weird compiler mode for just
one test.
2022-08-31 20:54:50 +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
Victor Petukhov 9be181f1ad [FE 1.0] Remove constraint system tests
These tests used the old type inference constraint system, so it didn't cover the current compiler logic almost at all

It'd be fine to implement similar test for the new type inference constraint system

^KT-52699
2022-08-02 10:29:38 +00:00
Ivan Kochurkin 502349c594 [FIR] Implement Native test infrastructure, add FirNativeSessionFactory 2022-07-25 23:30:09 +02:00
Dmitriy Novozhilov 8919703448 [Test] Extract CLI tests for plugins into separate directory 2022-07-20 09:07:26 +00:00
Georgy Bronnikov 320ba3db75 JVM_IR, FIR: add FIR tests for IR serialization 2022-05-19 12:02:41 +02:00
Ivan Kylchik 0f0b48f87b Move reporting of interpreter's backend errors tests to fir module 2022-05-18 21:20:01 +03:00
Ivan Kylchik 0b22cf6cb9 Rewrite ir interpreter's dump tests to box
Box tests will check the correctness of interpreter, meantime
by dumped ir we can understand that expression was folded.
2022-05-18 21:20:01 +03:00
Ivan Kylchik df7be06558 Add tests to check constant evaluation for intrinsic const declarations 2022-05-18 21:19:58 +03:00
Ilya Chernikov bd60d4b2a6 FIR LT: Add box inline tests for FIR + LT (failing on SMAP so far) 2022-03-30 08:34:21 +00:00
Ilya Chernikov 3220900abe FIR: add tests for IC with LT and new CLI pipeline 2022-03-30 08:32:10 +00:00
Victor Petukhov 683a3e74a0 [Compiler CLI] Implement reading language version settings from environment variable
^KT-51306 Fixed
2022-02-16 18:41:50 +03:00
Ivan Kylchik fca1909f4a Move interpreter's test from fir module to general tests-gen 2022-01-28 18:44:47 +00:00
sebastian.sellmair 3598ba1d45 [MPP][Test] Implement Diagnostics with mpp composite analysis tests
Using the 'MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE' test directive
will add support for testing "cli metadata compilation" and
"ide analysis" _like_ configurations. In this configuration,
dependsOn modules will not be analyzed together with dependents in
the same ModuleDescriptor, but will be passed as separate 'expectedBy'
dependency descriptor.

Used to cover ^KT-50120 inside kotlin.git
2021-12-21 21:31:42 +00:00