Add mock runtime to diagnostic tests.

Mock runtime contains function from file Standard.kt
This commit is contained in:
Stanislav Erokhin
2016-01-24 11:24:03 +03:00
parent 6ac73eb760
commit d7438d9f2b
6 changed files with 39 additions and 8 deletions
@@ -79,7 +79,7 @@ public abstract class KotlinMultiFileTestWithWithJava<M, F> extends KotlinLiteFi
@NotNull
protected CompilerConfiguration createCompilerConfiguration(File javaFilesDir) {
return KotlinTestUtils.compilerConfigurationForTests(
ConfigurationKind.JDK_ONLY,
ConfigurationKind.MOCK_RUNTIME,
TestJdkKind.MOCK_JDK,
Collections.singletonList(KotlinTestUtils.getAnnotationsJar()),
Collections.singletonList(javaFilesDir)
@@ -36,6 +36,11 @@ public class ForTestCompileRuntime {
return assertExists(new File("dist/kotlinc/lib/kotlin-runtime.jar"));
}
@NotNull
public static File mockRuntimeJarForTests() {
return assertExists(new File("dist/kotlin-mock-runtime-for-test.jar"));
}
@NotNull
public static File kotlinTestJarForTests() {
return assertExists(new File("dist/kotlinc/lib/kotlin-test.jar"));
@@ -17,10 +17,12 @@
package org.jetbrains.kotlin.test
enum class ConfigurationKind(
val withRuntime: Boolean,
val withReflection: Boolean
val withRuntime: Boolean = false,
val withMockRuntime: Boolean = false,
val withReflection: Boolean = false
) {
JDK_ONLY(withRuntime = false, withReflection = false),
NO_KOTLIN_REFLECT(withRuntime = true, withReflection = false),
JDK_ONLY(),
MOCK_RUNTIME(withMockRuntime = true),
NO_KOTLIN_REFLECT(withRuntime = true),
ALL(withRuntime = true, withReflection = true),
}
@@ -448,6 +448,9 @@ public class KotlinTestUtils {
JvmContentRootsKt.addJvmClasspathRoot(configuration, ForTestCompileRuntime.runtimeJarForTests());
JvmContentRootsKt.addJvmClasspathRoot(configuration, ForTestCompileRuntime.kotlinTestJarForTests());
}
else if (configurationKind.getWithMockRuntime()) {
JvmContentRootsKt.addJvmClasspathRoot(configuration, ForTestCompileRuntime.mockRuntimeJarForTests());
}
if (configurationKind.getWithReflection()) {
JvmContentRootsKt.addJvmClasspathRoot(configuration, ForTestCompileRuntime.reflectJarForTests());
}