Fix running tests from expect class by using FakeLightClasses

Unfortunately, IJ API requires us to return instances of
PsiClass/PsiMethod in order to proceed with run configuration creation.

In fact, those instances will be queried only by trivial requests, like
containingFile or name. Therefore, full-blown LightClasses are not
needed and even harmful, because for some declarations we can not build
proper light classes (like for expect declarations, for example)

Previously it mostly worked because most of declarations in common
indeed have corresponding Light-instances (because common source-set can
be seen from Java through JVM-part of a project).

^KT-34503 Fixed
This commit is contained in:
Dmitry Savvinov
2020-01-20 16:35:39 +03:00
parent cea612cba4
commit f78ea75431
2 changed files with 6 additions and 6 deletions
@@ -3,7 +3,7 @@ package sample
import kotlin.test.Test
import kotlin.test.assertTrue
expect class <lineMarker descr="Run Test" settings="Nothing here"><lineMarker descr="Has actuals in JS, JVM">SampleTests</lineMarker></lineMarker> {
expect class <lineMarker descr="Run Test" settings=" cleanJsBrowserTest jsBrowserTest --tests \"sample.SampleTests\" cleanJsNodeTest jsNodeTest --tests \"sample.SampleTests\" cleanJvmTest jvmTest --tests \"sample.SampleTests\" --continue"><lineMarker descr="Has actuals in JS, JVM">SampleTests</lineMarker></lineMarker> {
@Test
fun <lineMarker descr="Run Test" settings="Nothing here"><lineMarker descr="Has actuals in JS, JVM">testMe</lineMarker></lineMarker>()
fun <lineMarker descr="Run Test" settings=" cleanJsBrowserTest jsBrowserTest --tests \"sample.SampleTests.testMe\" cleanJsNodeTest jsNodeTest --tests \"sample.SampleTests.testMe\" cleanJvmTest jvmTest --tests \"sample.SampleTests.testMe\" --continue"><lineMarker descr="Has actuals in JS, JVM">testMe</lineMarker></lineMarker>()
}