mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-02 07:47:25 +07:00
Add LightProjectDescriptor with script-runtime dependency. Use it in PsiChecker tests.
GitOrigin-RevId: e856fd7cc29fa6bb3ca864b0dd3cf19174d86138
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ddcf3dcbd5
commit
3447dde8e6
@@ -1,3 +1,5 @@
|
||||
// RUNTIME_WITH_SCRIPT_RUNTIME
|
||||
|
||||
val c = true
|
||||
if (c) {
|
||||
2 + 3
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// RUNTIME_WITH_SCRIPT_RUNTIME
|
||||
|
||||
package org.my
|
||||
|
||||
val x = 1
|
||||
@@ -1,3 +1,5 @@
|
||||
// RUNTIME_WITH_SCRIPT_RUNTIME
|
||||
|
||||
fun f() {
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
// RUNTIME_WITH_SCRIPT_RUNTIME
|
||||
|
||||
val x = <error descr="[UNINITIALIZED_VARIABLE] Variable 'y' must be initialized">y</error>
|
||||
val y = 3
|
||||
+3
@@ -129,6 +129,9 @@ abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFix
|
||||
else if (InTextDirectivesUtils.isDirectiveDefined(fileText, "RUNTIME_WITH_REFLECT")) {
|
||||
return KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE_WITH_REFLECT
|
||||
}
|
||||
else if (InTextDirectivesUtils.isDirectiveDefined(fileText, "RUNTIME_WITH_SCRIPT_RUNTIME")) {
|
||||
return KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE_WITH_SCRIPT_RUNTIME
|
||||
}
|
||||
else if (InTextDirectivesUtils.isDirectiveDefined(fileText, "RUNTIME") ||
|
||||
InTextDirectivesUtils.isDirectiveDefined(fileText, "WITH_RUNTIME")) {
|
||||
return KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE
|
||||
|
||||
+3
@@ -130,6 +130,9 @@ abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFix
|
||||
else if (InTextDirectivesUtils.isDirectiveDefined(fileText, "RUNTIME_WITH_REFLECT")) {
|
||||
return KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE_WITH_REFLECT
|
||||
}
|
||||
else if (InTextDirectivesUtils.isDirectiveDefined(fileText, "RUNTIME_WITH_SCRIPT_RUNTIME")) {
|
||||
return KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE_WITH_SCRIPT_RUNTIME
|
||||
}
|
||||
else if (InTextDirectivesUtils.isDirectiveDefined(fileText, "RUNTIME") ||
|
||||
InTextDirectivesUtils.isDirectiveDefined(fileText, "WITH_RUNTIME")) {
|
||||
return KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE
|
||||
|
||||
+6
-1
@@ -19,7 +19,6 @@ package org.jetbrains.kotlin.idea.test;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.utils.PathUtil;
|
||||
|
||||
import java.io.File;
|
||||
@@ -44,6 +43,12 @@ public class KotlinWithJdkAndRuntimeLightProjectDescriptor extends KotlinJdkAndL
|
||||
PathUtil.getKotlinPathsForDistDirectory().getKotlinTestPath())
|
||||
);
|
||||
|
||||
@NotNull
|
||||
public static final KotlinWithJdkAndRuntimeLightProjectDescriptor INSTANCE_WITH_SCRIPT_RUNTIME = new KotlinWithJdkAndRuntimeLightProjectDescriptor(
|
||||
Arrays.asList(ForTestCompileRuntime.runtimeJarForTests(),
|
||||
PathUtil.getKotlinPathsForDistDirectory().getScriptRuntimePath())
|
||||
);
|
||||
|
||||
@NotNull
|
||||
public static final KotlinWithJdkAndRuntimeLightProjectDescriptor INSTANCE_WITH_REFLECT = new KotlinWithJdkAndRuntimeLightProjectDescriptor(
|
||||
Arrays.asList(ForTestCompileRuntime.runtimeJarForTests(),
|
||||
|
||||
Reference in New Issue
Block a user