[JS FIR] Enable invalidation with PL test for FIR
^KT-64446 Fixed
This commit is contained in:
committed by
Space Team
parent
6556f4fceb
commit
4a04a2fc4b
@@ -85,6 +85,14 @@ fun main(args: Array<String>) {
|
||||
model("incremental/invalidation/", pattern = "^([^_](.+))$", targetBackend = TargetBackend.JS_IR_ES6, recursive = false)
|
||||
}
|
||||
|
||||
testClass<AbstractJsIrInvalidationPerFileWithPLTest> {
|
||||
model("incremental/invalidationWithPL/", pattern = "^([^_](.+))$", targetBackend = TargetBackend.JS_IR, recursive = false)
|
||||
}
|
||||
|
||||
testClass<AbstractJsIrInvalidationPerModuleWithPLTest> {
|
||||
model("incremental/invalidationWithPL/", pattern = "^([^_](.+))$", targetBackend = TargetBackend.JS_IR, recursive = false)
|
||||
}
|
||||
|
||||
testClass<AbstractJsFirInvalidationPerFileTest> {
|
||||
model("incremental/invalidation/", pattern = "^([^_](.+))$", targetBackend = TargetBackend.JS_IR, recursive = false)
|
||||
}
|
||||
@@ -101,11 +109,11 @@ fun main(args: Array<String>) {
|
||||
model("incremental/invalidation/", pattern = "^([^_](.+))$", targetBackend = TargetBackend.JS_IR_ES6, recursive = false)
|
||||
}
|
||||
|
||||
testClass<AbstractJsIrInvalidationPerFileWithPLTest> {
|
||||
testClass<AbstractJsFirInvalidationPerFileWithPLTest> {
|
||||
model("incremental/invalidationWithPL/", pattern = "^([^_](.+))$", targetBackend = TargetBackend.JS_IR, recursive = false)
|
||||
}
|
||||
|
||||
testClass<AbstractJsIrInvalidationPerModuleWithPLTest> {
|
||||
testClass<AbstractJsFirInvalidationPerModuleWithPLTest> {
|
||||
model("incremental/invalidationWithPL/", pattern = "^([^_](.+))$", targetBackend = TargetBackend.JS_IR, recursive = false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,11 @@ import org.jetbrains.kotlin.diagnostics.DiagnosticReporterFactory
|
||||
import org.jetbrains.kotlin.ir.backend.js.MainModule
|
||||
import org.jetbrains.kotlin.ir.backend.js.ModulesStructure
|
||||
import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsGenerationGranularity
|
||||
import org.jetbrains.kotlin.ir.linkage.partial.PartialLinkageConfig
|
||||
import org.jetbrains.kotlin.ir.linkage.partial.PartialLinkageLogLevel
|
||||
import org.jetbrains.kotlin.ir.linkage.partial.PartialLinkageMode
|
||||
import org.jetbrains.kotlin.ir.linkage.partial.setupPartialLinkageConfig
|
||||
import org.jetbrains.kotlin.serialization.js.ModuleKind
|
||||
import org.jetbrains.kotlin.test.TargetBackend
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.File
|
||||
@@ -30,6 +35,23 @@ abstract class AbstractJsFirES6InvalidationPerFileTest :
|
||||
FirAbstractInvalidationTest(TargetBackend.JS_IR_ES6, JsGenerationGranularity.PER_FILE, "incrementalOut/invalidationFirES6/perFile")
|
||||
abstract class AbstractJsFirES6InvalidationPerModuleTest :
|
||||
FirAbstractInvalidationTest(TargetBackend.JS_IR_ES6, JsGenerationGranularity.PER_MODULE, "incrementalOut/invalidationFirES6/perModule")
|
||||
abstract class AbstractJsFirInvalidationPerFileWithPLTest :
|
||||
AbstractJsFirInvalidationWithPLTest(JsGenerationGranularity.PER_FILE, "incrementalOut/invalidationWithPL/perFile")
|
||||
abstract class AbstractJsFirInvalidationPerModuleWithPLTest :
|
||||
AbstractJsFirInvalidationWithPLTest(JsGenerationGranularity.PER_MODULE, "incrementalOut/invalidationWithPL/perModule")
|
||||
|
||||
abstract class AbstractJsFirInvalidationWithPLTest(granularity: JsGenerationGranularity, workingDirPath: String) :
|
||||
FirAbstractInvalidationTest(
|
||||
TargetBackend.JS_IR,
|
||||
granularity,
|
||||
workingDirPath
|
||||
) {
|
||||
override fun createConfiguration(moduleName: String, language: List<String>, moduleKind: ModuleKind): CompilerConfiguration {
|
||||
val config = super.createConfiguration(moduleName, language, moduleKind)
|
||||
config.setupPartialLinkageConfig(PartialLinkageConfig(PartialLinkageMode.ENABLE, PartialLinkageLogLevel.WARNING))
|
||||
return config
|
||||
}
|
||||
}
|
||||
|
||||
abstract class FirAbstractInvalidationTest(
|
||||
targetBackend: TargetBackend,
|
||||
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.incremental;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.jetbrains.kotlin.test.TargetBackend;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateJsTestsKt}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("js/js.translator/testData/incremental/invalidationWithPL")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class JsFirInvalidationPerFileWithPLTestGenerated extends AbstractJsFirInvalidationPerFileWithPLTest {
|
||||
@Test
|
||||
public void testAllFilesPresentInInvalidationWithPL() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/incremental/invalidationWithPL"), Pattern.compile("^([^_](.+))$"), null, TargetBackend.JS_IR, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("changeFunctionSignature")
|
||||
public void testChangeFunctionSignature() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidationWithPL/changeFunctionSignature/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceBecomeClass")
|
||||
public void testInterfaceBecomeClass() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidationWithPL/interfaceBecomeClass/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeFunction")
|
||||
public void testRemoveFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidationWithPL/removeFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeFunctionFromBlock")
|
||||
public void testRemoveFunctionFromBlock() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidationWithPL/removeFunctionFromBlock/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeFunctionFromChainCall")
|
||||
public void testRemoveFunctionFromChainCall() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidationWithPL/removeFunctionFromChainCall/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeFunctionFromElvis")
|
||||
public void testRemoveFunctionFromElvis() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidationWithPL/removeFunctionFromElvis/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeFunctionFromInline")
|
||||
public void testRemoveFunctionFromInline() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidationWithPL/removeFunctionFromInline/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeInlineFunction")
|
||||
public void testRemoveInlineFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidationWithPL/removeInlineFunction/");
|
||||
}
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.incremental;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.jetbrains.kotlin.test.TargetBackend;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateJsTestsKt}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("js/js.translator/testData/incremental/invalidationWithPL")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class JsFirInvalidationPerModuleWithPLTestGenerated extends AbstractJsFirInvalidationPerModuleWithPLTest {
|
||||
@Test
|
||||
public void testAllFilesPresentInInvalidationWithPL() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/incremental/invalidationWithPL"), Pattern.compile("^([^_](.+))$"), null, TargetBackend.JS_IR, false);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("changeFunctionSignature")
|
||||
public void testChangeFunctionSignature() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidationWithPL/changeFunctionSignature/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("interfaceBecomeClass")
|
||||
public void testInterfaceBecomeClass() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidationWithPL/interfaceBecomeClass/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeFunction")
|
||||
public void testRemoveFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidationWithPL/removeFunction/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeFunctionFromBlock")
|
||||
public void testRemoveFunctionFromBlock() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidationWithPL/removeFunctionFromBlock/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeFunctionFromChainCall")
|
||||
public void testRemoveFunctionFromChainCall() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidationWithPL/removeFunctionFromChainCall/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeFunctionFromElvis")
|
||||
public void testRemoveFunctionFromElvis() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidationWithPL/removeFunctionFromElvis/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeFunctionFromInline")
|
||||
public void testRemoveFunctionFromInline() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidationWithPL/removeFunctionFromInline/");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("removeInlineFunction")
|
||||
public void testRemoveInlineFunction() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidationWithPL/removeInlineFunction/");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user