151 Commits

Author SHA1 Message Date
Iaroslav Postovalov 9a2e4c6b41 [Tests] FIR support in JUnit 3 tests, port necessary subclasses
^KT-64404 Fixed
^KT-64438 Fixed
^KT-64407 Fixed
2024-03-19 17:56:29 +00:00
Wojciech Litewka cbabfc0fe2 [IR] Drop ir.ir2cfg module
#KTI-952 Fixed
#KT-65773 Related
2024-03-06 18:30:22 +00:00
Alexander Udalov f98a22e8e4 Fir2Ir: enable IR-based fake override builder
Invert the logic of IR/FIR2IR-based generators: change the CLI argument
to -Xuse-fir-fake-override-builder, test directive to
USE_FIR_BASED_FAKE_OVERRIDE_GENERATOR, etc.

The changes in test data caused by using IR fake override builder by
default are in the subsequent commit.

 #KT-61514
2024-02-29 10:14:31 +00:00
Nikita Nazarov 407448d8e3 [JVM] Implement new inlined variable naming format
^KT-65478 fixed
2024-02-23 23:59:13 +01:00
vladislav.grechko 224a4e1e3c Do not exclude codegen/box/script directory from JVM ABI tests 2024-02-22 07:32:35 +00:00
Ilya Chernikov cdf4b17052 K2 Scripting tests: adding tests on script decls visibility
fixes (makes it stable) behavior of the script top-level declarations
visibility in K2 scripts
2024-02-21 07:47:15 +00:00
Alexander Udalov 49c659b379 CLI: remove obsolete -Xdump-declarations-to
It was only used in the very old version of binary compatibility
validator. It was never supported in the JVM IR backend.
2024-02-01 23:37:23 +00:00
Ilya Chernikov d6c9a492ad K2 Scripting: disable K2 lightTree-based script tests
they were enabled by mistake and do not work properly until
LT parsing is implemented
depends on #KT-60127
2024-01-19 15:54:54 +00:00
Iaroslav Postovalov 29c68c8aa7 [Tests] Add JavaAgainstKotlin tests for K2
^KT-64405 Fixed
2024-01-15 23:25:47 +00:00
Dmitrii Gridin 2c0cf9cad8 [PSI2FIR] split AbstractRawFirBuilderLazyBodiesTestCase on ast and stub versions
This commit explicitly splits raw fir builder in lazy mode on
AST and stubs.
By default, in tests we have an AST tree loaded, so all our
`disallowTreeLoading` is useless in unit tests mode

^KT-64646 Fixed
^KT-64898
^KT-64899
^KT-64900
^KT-64901
2024-01-12 12:19:54 +00:00
Stanislav Ruban a5bae12915 Remove separate test configurations for JDK 21
^KT-58765

Now that JDK 21 was released as stable, we can remove separate test
configurations for testing the compiler with JDK 21 and reintegrate
the corresponding test data into standard test configurations.
2024-01-09 18:45:58 +00:00
vladislav.grechko 34bac48541 Add JVM ABI K1/K2 consistency tests 2023-12-26 10:18:19 +00:00
Alexander Udalov 0c77fa1fa4 Tests: remove LVT tests on old JVM backend 2023-12-18 21:42:35 +00:00
Alexander Udalov 5e330acd28 Tests: remove stepping tests on old JVM backend 2023-12-18 21:42:35 +00:00
Dmitriy Novozhilov b4947e6cfe [Test] Exclude K2 MPP codegen box tests from K1 generated suites
Those tests always were muted for K1 because of incompatible module
  structure in testdata, so there is no actual sense to even generate
  them for K1
2023-12-13 16:47:42 +00:00
Dmitriy Dolovov b5d8db0267 [test] Exclude "K1-only" from FIR IR text tests and "K2-only" from Classic IR text tests
^KT-60390
2023-12-12 13:57:48 +00:00
Alexander Udalov 1cf04916d6 Tests: remove bytecode listing tests for old JVM backend
These tests are mostly used to check ABI in case you're compiling a
library or library-like code, which is no longer possible (since old JVM
backend is only used in the IDE).
2023-11-02 10:59:29 +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 1d631500f5 Test: add K2 version of IR source ranges test
After this commit there are three different versions of
IR source range tests: classic (K1), FIR/PSI (K2), FIR/LT (K2).
Since 5 tests behave differently for FIR/PSI and FIR/LT,
in this commit their test data was set to FIR/LT state,
so relevant 5 tests are failing for FIR/PSI right now.
They will be fixed in two subsequent commits

Related to KT-59864, KT-60111, KT-59584
2023-10-10 13:38:51 +00:00
Mikhail Glukhikh 072757cdde Test: convert IR source ranges test to the new infrastructure
Related to KT-59864, KT-60111, KT-59584
2023-10-10 13:38:51 +00:00
Ivan Kylchik 1843eeb16b [FIR] Drop visualizer module
This module was created to compare type resolve in K1 and K2. But
overall, these tests contain a lot of bugs, and it is quite hard
to use it.
2023-09-13 12:55:14 +00:00
Alexander Korepanov be4f6beddb [JS Tests] Prepare JS tests for testing backend diagnostics
- Introducing a backend diagnostic handler.
 - Moving JS diagnostic tests from test-common to
   js.test to avoid circular module dependencies.

^KT-61886 Fixed
2023-09-13 12:19:15 +00:00
Alexander.Likhachev 6eaccc997f [Build] Fix the typo junit jupyter -> jupiter 2023-09-06 22:47:34 +00:00
Alexander.Likhachev 6f96be0b76 [Build] Get rid of the testApiJUnit5 method
#KTI-1349 In Progress
2023-09-06 22:47:34 +00:00
Dmitriy Novozhilov 2d334c4e71 [Test] Merge multiple abstract legacy test runners into a single one
There was only one real inheritor of AbstractFirBaseDiagnosticTest,
  so there is no need in the whole hierarchy of abstract test runners

Also AbstractFirOldFrontendLightClassesTest is not intended to check any
  diagnostics or CFG dumps, so this logic was removed (they still can be
  checked using non-legacy AbstractFirDiagnosticTest from the main test
  infrastructure)
2023-09-05 14:59:36 +00:00
Dmitrii Gridin c095b60fe8 [LL FIR] drop outdated LazyBodyIsNotTouchedTest
We have our own transformers and tests against compiler test data,
so separate test with compiler transformers is redundant
2023-09-04 12:37:12 +00:00
Pavel Kunyavskiy 91e96e9f31 [Fir2Ir] Introduce testing with IrFakeOverrideBuilder
^KT-61514
2023-08-31 13:12:15 +00:00
Kirill Rakhman bb8a46c3a0 [Test] Parallelize test generation 2023-08-28 08:02:05 +00:00
Dmitrii Gridin a2dc6ca8f2 [FIR] add RawFirBuilder test for script
^KT-60728
^KT-60519
2023-08-02 16:50:45 +00:00
Alexander Udalov 5f2ff06296 Add tests for JVM backend diagnostics with K2 light tree
In the vast majority of tests, diagnostics are reported at a slightly
different location in LT vs PSI. This is because in the light tree mode,
backend errors are reported basically on the start of the IR element,
which is for example the keyword "class" for a class and not its name as
in K1 or in K2+PSI. Similarly, the end of the diagnostic is at the
ending offset of the IR element.

Normally it would be a bit user-unfriendly to highlight the whole class
as red, starting from the keyword "class" and ending with the closing
brace "}". But remember that these are backend diagnostics in the K2+LT
mode, which is only possible in the compiler scenario, not in the IDE.
And in this case, the ending offset doesn't matter at all because it's
not presented to the user, and minor change in the starting offset is
not a problem as well.

There are some tests which legitimately fail in the LT mode because the
corresponding diagnostics haven't been supported. They will be dealt
with in subsequent commits:

  testPropertyInlineCycle
  testInlineCycle
  MultifileClasses.testJvmSynthetic
  testSuspendInlineCycle
  testIndirectInlineCycle

 #KT-59586
2023-07-29 01:14:29 +02:00
Ivan Kylchik d0da736b13 [FIR] Add the new test set to render diagnostics from IR const evaluator 2023-07-27 22:50:21 +00:00
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