[Tests] Revive KlibEvolutionTests

Allows CI testing for KT-44602, KT-44604, KT-44598, KT-44599, KT-66342

^KT-44602
This commit is contained in:
Vladimir Sukharev
2024-03-05 13:12:38 +01:00
committed by Space Team
parent a007551574
commit e03af07a1c
5 changed files with 15 additions and 5 deletions
+3
View File
@@ -1,3 +1,6 @@
// KT-44602: fail 2
// IGNORE_BACKEND_K1: JS_IR, JS_IR_ES6
// MODULE: lib
// FILE: A.kt
// VERSION: 1
@@ -1,3 +1,6 @@
// KT-66342: fail 1: `const val bar` has changed its value
// IGNORE_BACKEND_K1: JS_IR, JS_IR_ES6
// MODULE: lib
// FILE: A.kt
// VERSION: 1
@@ -63,8 +63,7 @@ import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static org.jetbrains.kotlin.test.InTextDirectivesUtils.IGNORE_BACKEND_DIRECTIVE_PREFIXES;
import static org.jetbrains.kotlin.test.InTextDirectivesUtils.isIgnoredTarget;
import static org.jetbrains.kotlin.test.InTextDirectivesUtils.*;
public class KotlinTestUtils {
public static String TEST_MODULE_NAME = "test-module";
@@ -475,7 +474,10 @@ public class KotlinTestUtils {
// * sometimes, for too common/general names, it shows many variants to navigate
// * it adds an additional step for navigation -- you must choose an exact file to navigate
public static void runTest0(DoTest test, TargetBackend targetBackend, String testDataFilePath) {
runTestImpl(testWithCustomIgnoreDirective(test, targetBackend, IGNORE_BACKEND_DIRECTIVE_PREFIXES), null, testDataFilePath);
String[] prefixes = test.getClass().getSimpleName().startsWith("Fir")
? new String[] { IGNORE_BACKEND_DIRECTIVE_PREFIX, IGNORE_BACKEND_K2_DIRECTIVE_PREFIX }
: IGNORE_BACKEND_DIRECTIVE_PREFIXES;
runTestImpl(testWithCustomIgnoreDirective(test, targetBackend, prefixes), null, testDataFilePath);
}
private static void runTestImpl(@NotNull DoTest test, @Nullable TestCase testCase, String testDataFilePath) {
+2
View File
@@ -270,6 +270,7 @@ fun Test.setUpJsBoxTests(jsEnabled: Boolean, jsIrEnabled: Boolean, firEnabled: B
when {
firEnabled && !es6Enabled -> {
include("org/jetbrains/kotlin/js/test/fir/*")
include("org/jetbrains/kotlin/js/testOld/klib/*")
exclude("org/jetbrains/kotlin/js/test/fir/FirJsES6BoxTestGenerated.class")
exclude("org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.class")
@@ -299,6 +300,7 @@ fun Test.setUpJsBoxTests(jsEnabled: Boolean, jsIrEnabled: Boolean, firEnabled: B
include("org/jetbrains/kotlin/incremental/*")
include("org/jetbrains/kotlin/js/testOld/compatibility/binary/JsKlibBinaryCompatibilityTestGenerated.class")
include("org/jetbrains/kotlin/js/testOld/klib/*")
include("org/jetbrains/kotlin/benchmarks/GenerateIrRuntime.class")
include("org/jetbrains/kotlin/integration/JsIrAnalysisHandlerExtensionTest.class")
@@ -14,7 +14,7 @@ import org.jetbrains.kotlin.compatibility.binary.*
import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles
import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.config.*
import org.jetbrains.kotlin.js.testOld.V8JsTestChecker
import org.jetbrains.kotlin.js.testOld.V8IrJsTestChecker
import org.jetbrains.kotlin.library.KLIB_FILE_EXTENSION
import org.jetbrains.kotlin.test.Directives
import org.jetbrains.kotlin.test.KotlinBaseTest
@@ -129,7 +129,7 @@ abstract class AbstractJsKlibEvolutionTest(val compilerType: CompilerType) : Abs
}
// TODO: ask js folks what to use here.
protected open val testChecker get() = V8JsTestChecker
protected open val testChecker get() = V8IrJsTestChecker
companion object {
private val String.klib: String get() = "$this.$KLIB_FILE_EXTENSION"