Commit Graph

47 Commits

Author SHA1 Message Date
Svyatoslav Kuzmich
b49ec3edb8 Disable generation of 1.2 coroutine tests for JS_IR
Add directive DONT_TARGET_EXACT_BACKEND.
This directive is needed to exclude JS_IR backned but keep "compatible"
JS backend.
2019-01-29 19:06:31 +03:00
Svyatoslav Kuzmich
aa811dcfb3 [JS IR BE] Add KJS_WITH_FULL_RUNTIME directive to compiler tests 2019-01-24 16:14:40 +03:00
Alexander Udalov
ec2dd58165 Remove LANGUAGE_VERSION from codegen tests on coroutines
Use `// !LANGUAGE: -ReleaseCoroutines` instead in tests which require
old (1.2) coroutines, and nothing in tests which require new coroutines
because master is already 1.3. Also remove superfluous API_VERSION and
other directives which have no effect anymore. Do not include runtime
automatically with `WITH_COROUTINES`/`COMMON_COROUTINES_TEST` in box
tests; require `WITH_RUNTIME` for that (majority of tests already had it
anyway), but remove it from bytecode text tests where runtime is always
added automatically. Fix the coroutine package selection code in
KotlinTestUtils and update the bunch files correspondingly.

Disable tests in `box/coroutines/noStdLib` on JVM: despite the name,
these tests were launched with stdlib because of the code in
CodegenTestCase, and they do not work without it because at least
CoroutineUtil.kt requires stdlib to compile correctly
2018-12-20 12:53:23 +01:00
Roman Artemev
d5acc8ff5b [JS BE] Set enclosing exception state in finally block
[Fix KT-28207]
2018-11-15 18:44:22 +03:00
Svyatoslav Kuzmich
4c38d55f21 [JS IR BE] Unmute tests 2018-10-15 00:03:45 +03:00
Ilmir Usmanov
c4038729ea Minor. Split tests with buildSequence into LV 1.2 and LV 1.3 versions 2018-09-18 14:56:08 +03:00
Anton Bannykh
2e709a81fa [JS IR BE] Arrays, varargs 2018-09-18 14:36:20 +03:00
Ilya Gorbunov
1b889c976a Use new sequence builders in tests
Coroutine tests will fail when LV=1.2 because there're no such builders
in kotlin.coroutines.experimental.

#KT-26678
2018-09-16 23:30:36 +03:00
Roman Artemev
36a99da820 Break/finally chain in suspend function test fix & workaround 2018-08-08 19:11:17 +03:00
Roman Artemev
efec82c0eb Update test data
* add new tests for coroutines
 * add copy of some tests without dependency on stdlib
2018-08-08 18:33:41 +03:00
Roman Artemev
c62e4b4fcf [JS IR BE] Support coroutines
* Move FinallyBlockLowering to common part
* Fix catching of dynamic exception
* Fix bridges for suspend functions
* Disable explicit cast to Unit
* Run lowering per module
* Update some test data
2018-08-08 18:33:39 +03:00
Roman Artemev
dec307799a Fix infinite loop in suspend function in case of return from finally [#KT-21961]
* add test
2018-07-25 23:04:57 +03:00
Roman Artemev
5241b37ad9 Fix fallthrough in suspendable switch [#KT-22694, #KT-23687]
* do not explicitly put break for each case
* add test for related cases
2018-07-24 20:19:35 +03:00
Denis Zharkov
0b3048f60a Replace trivial usages of suspendCoroutineOrReturn in tests
This is necessary since suspendCoroutineOrReturn gets removed in 1.3
2018-07-09 15:27:19 +03:00
Denis Zharkov
f23a0c8fea Add ContinuationAdapter to coroutine tests helpers
It allows having the same Continuation implementations for different
API versions
2018-07-09 15:27:19 +03:00
Mikhael Bogdanov
be40127ab3 Mute coroutines ir-tests in jvm 2018-07-04 15:33:41 +02:00
Anton Bannykh
5fdc304a51 JS_IR: mute coroutine tests 2018-06-09 19:15:38 +03:00
Ilmir Usmanov
f60787d57c Move coroutines to kotlin.coroutines package: tests
Introduce COMMON_COROUTINES_TEST directive.
Every test with this directive is run twice: one time with
language version 1.2 and kotlin.coroutines.experimental package
and the other time with language version 1.3 and kotlin.coroutines
package. Each run is a separate method: with suffixes _1_2 and _1_3
respectively.
However, since codegen of release coroutines is not supported in JS
backend, we generate only one method: with suffix _1_2.
 #KT-23362
2018-04-23 21:51:59 +03:00
Denis Zharkov
45d5f6a950 Add test for obsolete issue
#KT-19467 Obsolete
2017-08-08 18:52:21 +07:00
Denis Zharkov
d92c403f9e Move helpers for coroutine tests in separate package
It will help to skip their content when rendering bytecode listing
for box tests
2017-05-05 14:01:50 +03:00
Igor Chevdar
962bce19a2 Enabled tests on coroutines for native 2017-05-03 10:42:07 +03:00
Alexey Andreev
c8c3d24b45 Fix non-suspending labeled loop in suspend function
Fix bug when labeled loop, which does not contain suspend calls
in its body, was losing its label
2017-04-28 10:52:14 +03:00
Ilya Matveev
a5e4e0284e Mute some box tests for native backend
This patch mutes the following test categories:
   * Tests with java dependencies (System class,
     java stdlib, jvm-oriented annotations etc).
   * Coroutines tests.
   * Reflection tests.
   * Tests with an inheritance from the standard
     collections.
2017-03-10 19:59:37 +03:00
Denis Zharkov
c362a9154b Rename SUSPENDED_MARKER to COROUTINE_SUSPENDED 2017-01-27 23:24:13 +03:00
Denis Zharkov
8fa8ba7055 Move coroutine-related runtime parts to kotlin.coroutines.experimental package
#KT-15975 Fixed
2017-01-27 23:24:13 +03:00
Denis Zharkov
6a1ad3a279 Get rid of unnecessary additional declarations in tests 2017-01-14 13:24:53 +03:00
Roman Elizarov
8d6a913cee CoroutineContext and ContinuationInterceptor (instead of dispatcher) 2017-01-14 13:24:53 +03:00
Denis Zharkov
2cb9d3a8ad Move coroutine intrinsics to kotlin.coroutine.intrinsics package
Also rename val SUSPENDED to SUSPENDED_MARKER

 #KT-15698 Fixed
2017-01-14 13:24:53 +03:00
Alexey Andreev
a016147a79 JS: fix translation of return statement surrounded by try..finally block in suspend lambda. See KT-15625 2017-01-12 18:12:39 +03:00
Stanislav Erokhin
b527a4d158 Global rename in test data for coroutines
(cherry picked from commit 132f97b)
2016-12-15 23:58:26 +03:00
Alexey Andreev
e2d969d8b0 JS: implement new coroutine convention 2016-12-15 23:58:20 +03:00
Stanislav Erokhin
e014fb7181 Added coroutine import to back-end test. 2016-12-15 23:57:52 +03:00
Stanislav Erokhin
7d1b883171 Replace @Suspend to suspend in box tests. 2016-12-15 23:57:50 +03:00
Denis Zharkov
6649f64e9f Support new coroutine convention in JVM backend 2016-12-15 23:57:40 +03:00
Alexey Andreev
bf74400776 JS: re-enable coroutine tests for JS backend 2016-12-09 14:56:19 +03:00
Denis Zharkov
b8e1ce7a05 Report error on non-tail suspend-calls
It only concerns calls inside another suspend function

 #KT-14924 In Progress
2016-12-01 10:11:37 +03:00
Denis Zharkov
fcd9ee037e Support coroutines stack-unwinding in JVM backend
#KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Denis Zharkov
27e4caf046 Temporary disable coroutine tests in JS backend
#KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Denis Zharkov
1f98accad2 Support new suspend convention in JVM backend partially
Stack-unwinding does not work yet

 #KT-14924 In Progress
2016-11-29 14:14:50 +03:00
Alexey Andreev
23428c9544 JS: fix coroutine test. Fix hanging IDEA tests 2016-11-23 17:01:03 +03:00
Alexey Andreev
40e00a62f5 JS: fix translation of augmented assignment when RHS changes value of LHS 2016-11-23 12:19:03 +03:00
Alexey Andreev
dc8e90809c JS: coroutines: fix handling of throw statement inside try/catch block when controller has handleSuspend function 2016-11-23 12:19:02 +03:00
Denis Zharkov
01c21e218a Add special tests for interceptRun support
Basically they're built upon basic coroutine tests, but for each of them
different interceptResume implementation are injected
(currently there are 12 of them).

It might be more simple just to generated additional testData, but I see this
more problematic in a sense of further maintenance

Note that all tests add idempotent 'interceptRun' operators,
which just execute given lambda in the current thread

 #KT-14891 Fixed
2016-11-22 14:33:40 +03:00
Alexey Andreev
e2dc7ba37e JS: coroutines: fixes after code review 2016-11-16 19:29:39 +03:00
Alexey Andreev
2d315c3df8 JS: coroutines: fix translation of try/finally block without catch 2016-11-16 19:29:35 +03:00
Alexey Andreev
22aea1cf12 JS: fix translation of return statement surrounded by finally block. Temporarily suppress corresponding test case for JVM backend 2016-11-16 19:29:34 +03:00
Alexey Andreev
eae0ceed86 JS: add coroutines tests 2016-11-16 19:29:34 +03:00