Get rid of CodegenTestCase from CodegenTestsOnAndroidGenerator superclass
This commit is contained in:
@@ -140,7 +140,7 @@ public abstract class CodegenTestCase extends KotlinBaseTest<KotlinBaseTest.Test
|
||||
return configuration;
|
||||
}
|
||||
|
||||
protected static void updateConfigurationByDirectivesInTestFiles(
|
||||
public static void updateConfigurationByDirectivesInTestFiles(
|
||||
@NotNull List<TestFile> testFilesWithConfigurationDirectives,
|
||||
@NotNull CompilerConfiguration configuration
|
||||
) {
|
||||
|
||||
@@ -7,7 +7,6 @@ package org.jetbrains.kotlin.test
|
||||
|
||||
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
|
||||
abstract class KotlinBaseTest<F : KotlinBaseTest.TestFile> : KtUsefulTestCase() {
|
||||
|
||||
@@ -56,17 +55,7 @@ abstract class KotlinBaseTest<F : KotlinBaseTest.TestFile> : KtUsefulTestCase()
|
||||
}
|
||||
|
||||
protected open fun extractConfigurationKind(files: List<F>): ConfigurationKind {
|
||||
var addRuntime = false
|
||||
var addReflect = false
|
||||
for (file in files) {
|
||||
if (InTextDirectivesUtils.isDirectiveDefined(file.content, "WITH_RUNTIME")) {
|
||||
addRuntime = true
|
||||
}
|
||||
if (InTextDirectivesUtils.isDirectiveDefined(file.content, "WITH_REFLECT")) {
|
||||
addReflect = true
|
||||
}
|
||||
}
|
||||
return if (addReflect) ConfigurationKind.ALL else if (addRuntime) ConfigurationKind.NO_KOTLIN_REFLECT else ConfigurationKind.JDK_ONLY
|
||||
return Companion.extractConfigurationKind(files)
|
||||
}
|
||||
|
||||
|
||||
@@ -106,4 +95,29 @@ abstract class KotlinBaseTest<F : KotlinBaseTest.TestFile> : KtUsefulTestCase()
|
||||
|
||||
override fun toString(): String = name
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun extractConfigurationKind(files: List<TestFile>): ConfigurationKind {
|
||||
var addRuntime = false
|
||||
var addReflect = false
|
||||
for (file in files) {
|
||||
if (InTextDirectivesUtils.isDirectiveDefined(file.content, "WITH_RUNTIME")) {
|
||||
addRuntime = true
|
||||
}
|
||||
if (InTextDirectivesUtils.isDirectiveDefined(file.content, "WITH_REFLECT")) {
|
||||
addReflect = true
|
||||
}
|
||||
}
|
||||
return if (addReflect) ConfigurationKind.ALL else if (addRuntime) ConfigurationKind.NO_KOTLIN_REFLECT else ConfigurationKind.JDK_ONLY
|
||||
}
|
||||
|
||||
fun getTestJdkKind(files: List<TestFile>): TestJdkKind {
|
||||
for (file in files) {
|
||||
if (InTextDirectivesUtils.isDirectiveDefined(file.content, "FULL_JDK")) {
|
||||
return TestJdkKind.FULL_JDK
|
||||
}
|
||||
}
|
||||
return TestJdkKind.MOCK_JDK
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user