Add Contract tests for JS
This commit is contained in:
@@ -108,6 +108,14 @@ fun main(args: Array<String>) {
|
||||
model("codegen/boxInline/suspend/", targetBackend = TargetBackend.JS_IR)
|
||||
}
|
||||
|
||||
testClass<AbstractJsInlineContractsTests> {
|
||||
model("codegen/boxInline/contracts/", targetBackend = TargetBackend.JS)
|
||||
}
|
||||
|
||||
testClass<AbstractIrJsInlineContractsTests> {
|
||||
model("codegen/boxInline/contracts/", targetBackend = TargetBackend.JS_IR)
|
||||
}
|
||||
|
||||
testClass<AbstractJsLegacyPrimitiveArraysBoxTest> {
|
||||
model("codegen/box/arrays", targetBackend = TargetBackend.JS)
|
||||
}
|
||||
|
||||
+5
@@ -400,6 +400,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/arrays/indicesChar.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineInitializer.kt")
|
||||
public void testInlineInitializer() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/arrays/inlineInitializer.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("iterator.kt")
|
||||
public void testIterator() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/arrays/iterator.kt");
|
||||
|
||||
Generated
+86
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. 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.js.test.semantics;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.TargetBackend;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("compiler/testData/codegen/boxInline/contracts")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class IrJsInlineContractsTestsGenerated extends AbstractIrJsInlineContractsTests {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInContracts() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("cfgDependendValInitialization.kt")
|
||||
public void testCfgDependendValInitialization() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/cfgDependendValInitialization.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("complexInitializer.kt")
|
||||
public void testComplexInitializer() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/complexInitializer.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("complexInitializerWithStackTransformation.kt")
|
||||
public void testComplexInitializerWithStackTransformation() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/complexInitializerWithStackTransformation.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("definiteLongValInitialization.kt")
|
||||
public void testDefiniteLongValInitialization() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/definiteLongValInitialization.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("definiteNestedValInitialization.kt")
|
||||
public void testDefiniteNestedValInitialization() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/definiteNestedValInitialization.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("definiteValInitInInitializer.kt")
|
||||
public void testDefiniteValInitInInitializer() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitInInitializer.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("definiteValInitialization.kt")
|
||||
public void testDefiniteValInitialization() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitialization.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nonLocalReturn.kt")
|
||||
public void testNonLocalReturn() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/nonLocalReturn.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nonLocalReturnWithCycle.kt")
|
||||
public void testNonLocalReturnWithCycle() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/nonLocalReturnWithCycle.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyInitialization.kt")
|
||||
public void testPropertyInitialization() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/propertyInitialization.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("valInitializationAndUsageInNestedLambda.kt")
|
||||
public void testValInitializationAndUsageInNestedLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/valInitializationAndUsageInNestedLambda.kt");
|
||||
}
|
||||
}
|
||||
+5
@@ -400,6 +400,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/arrays/indicesChar.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineInitializer.kt")
|
||||
public void testInlineInitializer() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/arrays/inlineInitializer.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("iterator.kt")
|
||||
public void testIterator() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/arrays/iterator.kt");
|
||||
|
||||
Generated
+86
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. 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.js.test.semantics;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.TargetBackend;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("compiler/testData/codegen/boxInline/contracts")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class JsInlineContractsTestsGenerated extends AbstractJsInlineContractsTests {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInContracts() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/contracts"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
|
||||
}
|
||||
|
||||
@TestMetadata("cfgDependendValInitialization.kt")
|
||||
public void testCfgDependendValInitialization() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/cfgDependendValInitialization.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("complexInitializer.kt")
|
||||
public void testComplexInitializer() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/complexInitializer.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("complexInitializerWithStackTransformation.kt")
|
||||
public void testComplexInitializerWithStackTransformation() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/complexInitializerWithStackTransformation.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("definiteLongValInitialization.kt")
|
||||
public void testDefiniteLongValInitialization() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/definiteLongValInitialization.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("definiteNestedValInitialization.kt")
|
||||
public void testDefiniteNestedValInitialization() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/definiteNestedValInitialization.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("definiteValInitInInitializer.kt")
|
||||
public void testDefiniteValInitInInitializer() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitInInitializer.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("definiteValInitialization.kt")
|
||||
public void testDefiniteValInitialization() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/definiteValInitialization.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nonLocalReturn.kt")
|
||||
public void testNonLocalReturn() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/nonLocalReturn.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nonLocalReturnWithCycle.kt")
|
||||
public void testNonLocalReturnWithCycle() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/nonLocalReturnWithCycle.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyInitialization.kt")
|
||||
public void testPropertyInitialization() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/propertyInitialization.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("valInitializationAndUsageInNestedLambda.kt")
|
||||
public void testValInitializationAndUsageInNestedLambda() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/contracts/valInitializationAndUsageInNestedLambda.kt");
|
||||
}
|
||||
}
|
||||
js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsLegacyPrimitiveArraysBoxTestGenerated.java
Generated
+5
@@ -154,6 +154,11 @@ public class JsLegacyPrimitiveArraysBoxTestGenerated extends AbstractJsLegacyPri
|
||||
runTest("compiler/testData/codegen/box/arrays/indicesChar.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineInitializer.kt")
|
||||
public void testInlineInitializer() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/arrays/inlineInitializer.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("iterator.kt")
|
||||
public void testIterator() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/arrays/iterator.kt");
|
||||
|
||||
+5
-1
@@ -31,6 +31,8 @@ abstract class AbstractInlineDefaultValuesTests : BorrowedInlineTest("defaultVal
|
||||
|
||||
abstract class AbstractInlineSuspendTests : BorrowedInlineTest("suspend/")
|
||||
|
||||
abstract class AbstractJsInlineContractsTests : BorrowedInlineTest("contracts/")
|
||||
|
||||
abstract class AbstractBoxJsTest : BasicBoxTest(
|
||||
BasicBoxTest.TEST_DATA_DIR_PATH + "box/",
|
||||
"box/"
|
||||
@@ -84,4 +86,6 @@ abstract class AbstractIrEnumValuesInlineTests : BorrowedIrInlineTest("enum/")
|
||||
|
||||
abstract class AbstractIrInlineDefaultValuesTests : BorrowedIrInlineTest("defaultValues/")
|
||||
|
||||
abstract class AbstractIrInlineSuspendTests : BorrowedIrInlineTest("suspend/")
|
||||
abstract class AbstractIrInlineSuspendTests : BorrowedIrInlineTest("suspend/")
|
||||
|
||||
abstract class AbstractIrJsInlineContractsTests : BorrowedIrInlineTest("contracts/")
|
||||
Reference in New Issue
Block a user