2983 Commits

Author SHA1 Message Date
Vladimir Sukharev 0ae7c66fc8 [Tests] Drop DCE tests
^KT-44602
2024-03-16 07:50:33 +00:00
Vladimir Sukharev e03af07a1c [Tests] Revive KlibEvolutionTests
Allows CI testing for KT-44602, KT-44604, KT-44598, KT-44599, KT-66342

^KT-44602
2024-03-16 07:50:33 +00:00
Dmitriy Dolovov cec36355b2 [JS] Don't turn on PL in tests with IGNORE_ERRORS directive
^KT-64817
2024-03-14 07:53:48 +00:00
Mads Ager b0bc017a16 [Parcelize] Add test for parcelize in multiplatform setting.
This tests that classes in common code can have code generated
for them in android compilations.
2024-03-14 06:52:19 +00:00
Artem Kobzar 77f0cba23f [K/JS] Introduce v2015 target 2024-03-06 12:21:38 +00:00
Ilya Goncharov b157a8eae5 [Wasm] Add wasm target to Klib manifest
^KT-66327 fixed
2024-03-06 10:57:50 +00:00
Artem Kobzar 8d4948c3ee [K/Wasm] Generate .d.ts tests for K/Wasm in the same way as we do for K/JS ^KT-65778 Fixed 2024-03-05 15:33:56 +00:00
Dmitriy Dolovov b3efc05728 [Test] Rename JsBackendDiagnosticsHandler -> KlibBackendDiagnosticsHandler
^KT-64393
2024-02-29 16:44:45 +00:00
Dmitriy Dolovov a4f2a4438b [Test] Move JsBackendDiagnosticsHandler to common test infra
^KT-64393
2024-02-29 16:44:45 +00:00
Artem Kobzar 6a2e785abd [K/JS, TEST] Enable TS export tests for FIR ^KT-64421 Fixed 2024-02-28 16:52:27 +00:00
Dmitriy Dolovov f204293e4d [Test] Unify work with KLIB artifact paths and dependencies
Unify functions from `JsEnvironmentConfigurator` and
`WasmEnvironmentConfigurator` that do the same logic. Make this logic
also be available for `NativeEnvironmentConfigurator`:
- get*ArtifactSimpleName()
- get*KlibArtifactPath()
- get*KlibOutputDir()
- getAllRecursiveLibrariesFor()
- getAllRecursiveDependenciesFor()
- getAllDependenciesMappingFor()
- getKlibDependencies()

This would allow to have the same logic in one place, and also
reuse it in `IrBackendFacade`s to be implemented for Native.

^KT-65117
2024-02-27 15:22:47 +00:00
Nikita Nazarov 407448d8e3 [JVM] Implement new inlined variable naming format
^KT-65478 fixed
2024-02-23 23:59:13 +01:00
Evgeniy.Zhelenskiy f05c972efb [K2, CLI] Support endOffset in Kotlin CLI
Duplicated messages in testdata appeared because default renderer
renders diagnostic spans ambiguously. It shows only start position.
In fact, there are 3 failures, 2 of them distinguish only by the
diagnostic end offset. See youtrack for more information.

The issue about inconvenient rendering is KT-64989.

#KT-64608
2024-02-05 13:26:13 +00:00
Alexander Udalov 9d5e1bdc47 CLI: remove obsolete -Xallow-result-return-type 2024-02-01 23:37:23 +00:00
Sergej Jaskiewicz a5c8ecae0b [test] Support dumping rendered diagnostics from multiple modules 2024-01-30 20:47:09 +00:00
Sergej Jaskiewicz f39335b3f7 [klib] Don't pass around metadata serialization closure
Pass the metadata serializer instance instead. This allows to further
reduce code duplication by introducing the common interface
`KlibSingleFileMetadataSerializer` for abstracting away K1 and K2
representation of a source file, as well as reusing
`Fir2KlibMetadataSerializer` across different backends.

KT-64392
2024-01-29 21:07:43 +00:00
Sergej Jaskiewicz c335cd0b1e [IR] Remove unused IrMessageLogger from serialization logic 2024-01-29 21:07:43 +00:00
Sergej Jaskiewicz f88d09a2f6 [IR] Move KtDiagnosticReporterWithImplicitIrBasedContext to ir.tree
So that it could be accessible from the `ir.serialization.common` module
2024-01-29 21:07:43 +00:00
Alexander Korepanov 561be747c1 [JS FIR Tests] Add multimodule order test for FIR
^KT-64451 Fixed
2024-01-17 10:32:46 +00:00
Alexander Korepanov b672e5c131 [JS FIR Tests] Add source map smoke test for FIR
^KT-64450 Fixed
2024-01-17 10:32:46 +00:00
Sergej Jaskiewicz eda30ff704 [klib] Implement diagnostics for clashing KLIB signatures
Now, we detect clashing signatures during serialization to KLIB and
report a compiler error if two or more declarations have the same
`IdSignature`

For example, for the following code:
```kotlin
@Deprecated("", level = DeprecationLevel.HIDDEN)
fun foo(): String = ""

fun foo(): Int = 0
```

the compiler will produce this diagnostic:
```
e: main.kt:1:1 Platform declaration clash: The following declarations
       have the same KLIB signature (/foo|foo(){}[0]):
    fun foo(): String defined in root package
    fun foo(): Int defined in root package
e: main.kt:4:1 Platform declaration clash: The following declarations
       have the same KLIB signature (/foo|foo(){}[0]):
    fun foo(): String defined in root package
    fun foo(): Int defined in root package
```

Note that we report this diagnostic during serialization and not earlier
(e.g., in fir2ir) for more robustness, so ensure that we check
exactly the signatures that will be written to a KLIB.
If we later introduce some annotation for customizing a declaration's
signature (e.g., for preserving binary compatibility), this
diagnostic will continue to work as expected.

^KT-63670 Fixed
2024-01-12 15:59:28 +00:00
Nikolay Lunyak cf4c55e02d [FIR JS] Create an LT diagnostics with BE runner 2024-01-12 13:42:23 +00:00
Nikolay Lunyak 8a4212f140 [FIR JS] Create an LT diagnostics runner 2024-01-12 13:42:23 +00:00
Nikolay Lunyak f7f5ac080f [FIR JS] Create an LT Box runner 2024-01-12 13:42:23 +00:00
Alexander Korepanov 6df0e0c847 [JS FIR] Enable FirJsLineNumberTests for FIR
^KT-64426 Fixed
2024-01-10 19:02:15 +00:00
Alexander Korepanov ac30911497 [JS tests] Split FIR and IR output test dirs 2024-01-10 19:02:15 +00:00
Nikolay Lunyak f52648af5f [FIR] Support CHECK_TYPE in K2 JS tests
^KT-60056
2024-01-09 10:47:13 +00:00
Alexander Korepanov 6556acabba [JS FIR] Enable FIR JS stepping tests
^KT-64422 Fixed
2024-01-08 12:38:37 +00:00
Artem Kobzar 567433cc12 [K/Wasm, K/JS] Unmute explicit backing fields tests 2024-01-05 17:27:31 +00:00
Alexander Korepanov 4a04a2fc4b [JS FIR] Enable invalidation with PL test for FIR
^KT-64446 Fixed
2023-12-20 19:04:31 +00:00
Marco Pennekamp 76a4b32c1f [Test] JS backend recompilation tests: Dispose the test root disposable of the subordinate incremental configuration
- The incremental configuration for JS recompilation tests creates its
  own test root disposable. It needs to be properly handled to avoid
  disposable leaks.
- The incremental configuration's disposable is registered with the
  parent configuration's disposable because it lives in its scope and
  should thus not be a root disposable. It's also disposed at the end of
  `transform` because the incremental configuration's lifetime ends
  there.

^KT-64099 fixed
2023-12-19 11:12:23 +00:00
Marco Pennekamp a4fc658fb3 [Test] Use testRootDisposable instead of leaking test disposable in ApiTest
- `testDisposable` is already managed by `KtUsefulTestCase`, so disposal
  support comes for free. This replaces the previous `TestDisposable`,
  which was never disposed properly.

^KT-64099
2023-12-19 11:12:23 +00:00
Marco Pennekamp 3497809ebd [Test] Add missing disposal for test root disposables
^KT-64099
2023-12-19 11:12:23 +00:00
Marco Pennekamp 32fe29b8cc [Test] Add debug names to unnamed test disposables
- This helps to track down disposables which are never disposed, and
  reduces confusion when printing disposables in general (the names will
  now be meaningful, instead of endless lists of "newDisposable" and
  "TestDisposable").

^KT-64099
2023-12-19 11:12:23 +00:00
Artem Kobzar 2530cba82a [K/JS] Compile Kotlin coroutines as JS generator ^KT-63038 Fixed 2023-12-18 17:13:07 +00:00
Dmitriy Dolovov 46081f968d [KLIB Resolver] Report KLIB resolver issues as compiler messages
The reason of this change is to make messages (especially warnings)
that are reported by the KLIB resolver become visible to the end user.
This can be achieved to forwarding such messages to the appropriate
compiler's components such as
`org.jetbrains.kotlin.cli.common.messages.MessageCollector` and
`org.jetbrains.kotlin.ir.util.IrMessageLogger`.

Also: The default `DummyLogger` should be used as minimal as possible.
Because it just forwards messages to the standard output (console)
where they can remain unattended. When the compiler is executed
from the Gradle plugin such messages appear only in DEBUG Gradle's log.

^KT-63573
2023-12-18 13:03:40 +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
Sergej Jaskiewicz f844a86057 [utils] Introduce the bind function and use it throughout 2023-12-13 10:04:45 +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
Artem Kobzar 98186ec283 [K/JS] Add ES6 typescript tests + fix a few bugs for it 2023-11-30 13:37:06 +00:00
Alexander Korepanov b1465fbfb8 [JS FIR] Enable warnings and infos for JS FIR tests 2023-11-27 14:31:31 +00:00
Dmitriy Novozhilov e38b25c278 [FIR2IR] Make convertAndActualize method the only entrypoint to fir2ir
Fir2Ir conversion consists of multiple steps with complex logic (like
  conversion of each module, actualization, plugins application, constant
  evaluation), and to ensure that they all are executed correctly it's
  convenient to have the single entry point for all this machinery
2023-11-27 10:17:54 +00:00
Dmitriy Novozhilov 075010b14e [Test] Get rid of some properties in IrBackendInput
`fir2IrComponents`, `irActualizerResult` and `dependentIrModuleFragments`
  were used in `IrActualizerAndPluginsFacade`, which was removed in the
  previous commit
2023-11-27 10:17:54 +00:00
Dmitriy Novozhilov 1303a33bea [Test] Get rid of IrActualizerAndPluginsFacade
IR actualization and IR plugins will be moved into base Fir2Ir facades
  in the following commits, so this facade is not needed anymore

It was easier and cleanlier to remove this facade first and only after
  that modify base facades
2023-11-27 10:17:54 +00:00
Artem Kobzar ff50d40b32 [K/JS] Rework kotlin tests compilation to make it works with per-file granularity ^KT-61525 Fixed 2023-11-16 19:02:04 +00:00
Ivan Kylchik 0a6f711a41 [JS_IR] Use IrModuleFragment as input to lowering instead of iterable
This way we will be able to reuse existing utils
to create a lowering.

#KT-63073
2023-11-16 12:03:41 +00:00
Alexander Korepanov ec71fe20e2 [JS IR] Fix file name clashes during JS BE invalidation 2023-10-30 09:14:16 +00:00
Alexander Korepanov bf80d55fc3 [JS IR test] Use relative paths for klib building in invalidation tests 2023-10-30 09:14:15 +00:00
Alexander Korepanov 27b458c222 [JS IR test] Support multiplatform for invalidation tests 2023-10-30 09:14:15 +00:00
Svyatoslav Kuzmich 0295057520 Refactor: extract test generation regexp into a common util object 2023-10-12 13:26:58 +00:00