[JS IR] Generate JS Klib ABI tests
- add first test
This commit is contained in:
committed by
TeamCityServer
parent
c3c2bb5884
commit
23d7f94dca
@@ -0,0 +1,4 @@
|
||||
|
||||
class C
|
||||
|
||||
class E
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
class C
|
||||
@@ -0,0 +1,6 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
STEP 1:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.1 -> l1.kt
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
|
||||
class D {
|
||||
fun foo(): String = stable(C())
|
||||
fun stable(c: C): String = "K"
|
||||
|
||||
fun bar(): String = exp(E())
|
||||
fun exp(e: E): String = "FAIL1"
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
fun test1(d: D): String {
|
||||
try {
|
||||
d.bar()
|
||||
} catch(ex: Throwable) {
|
||||
return "O"
|
||||
}
|
||||
|
||||
return "FAIL2"
|
||||
}
|
||||
|
||||
fun test2(d: D): String {
|
||||
return d.foo()
|
||||
}
|
||||
|
||||
|
||||
fun box(): String {
|
||||
return test1(D()) + test2(D())
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
@@ -0,0 +1,7 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
|
||||
STEP 1:
|
||||
libs: lib1
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
class C {
|
||||
fun o(): String = "K"
|
||||
}
|
||||
|
||||
class E {
|
||||
fun e(): String = "FAIL"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
class C {
|
||||
fun o(): String = "K"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
STEP 1:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.1 -> l1.kt
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
|
||||
|
||||
class D {
|
||||
fun foo(): String = stable().o()
|
||||
fun stable(): C = C()
|
||||
|
||||
fun bar(): String = exp().e()
|
||||
fun exp(): E = E()
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
fun test1(d: D): String {
|
||||
try {
|
||||
d.bar()
|
||||
} catch(ex: Throwable) {
|
||||
return "O"
|
||||
}
|
||||
|
||||
return "FAIL2"
|
||||
}
|
||||
|
||||
fun test2(d: D): String {
|
||||
return d.foo()
|
||||
}
|
||||
|
||||
|
||||
fun box(): String {
|
||||
return test1(D()) + test2(D())
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
@@ -0,0 +1,7 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
|
||||
STEP 1:
|
||||
libs: lib1
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
class C {
|
||||
fun o(): String = "K"
|
||||
}
|
||||
|
||||
class E {
|
||||
fun e(): String = "FAIL"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
class C {
|
||||
fun o(): String = "K"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
STEP 1:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.1 -> l1.kt
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
interface I<T> {
|
||||
val o: T
|
||||
}
|
||||
|
||||
class ST : I<C> {
|
||||
override val o: C = C()
|
||||
}
|
||||
|
||||
class EX: I<E> {
|
||||
override val o: E = E()
|
||||
}
|
||||
|
||||
class D {
|
||||
fun foo(): String = stable().o.o()
|
||||
fun stable(): ST = ST()
|
||||
|
||||
fun bar(): String = exp().o.e()
|
||||
fun exp(): EX = EX()
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
fun test1(d: D): String {
|
||||
try {
|
||||
d.bar()
|
||||
} catch(ex: Throwable) {
|
||||
return "O"
|
||||
}
|
||||
|
||||
return "FAIL2"
|
||||
}
|
||||
|
||||
fun test2(d: D): String {
|
||||
return d.foo()
|
||||
}
|
||||
|
||||
|
||||
fun box(): String {
|
||||
return test1(D()) + test2(D())
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
@@ -0,0 +1,7 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
|
||||
STEP 1:
|
||||
libs: lib1
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
class C {
|
||||
fun o(): String = "K"
|
||||
}
|
||||
|
||||
class E {
|
||||
fun e(): String = "FAIL"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
class C {
|
||||
fun o(): String = "K"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
STEP 1:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.1 -> l1.kt
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
interface I<T> {
|
||||
val o: T
|
||||
}
|
||||
|
||||
class D {
|
||||
fun foo(): String = stable().o.o()
|
||||
fun stable(): I<C> = object : I<C> {
|
||||
override val o: C = C()
|
||||
}
|
||||
|
||||
fun bar(): String = exp().o.e()
|
||||
fun exp(): I<E> = object : I<E> {
|
||||
override val o: E = E()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
fun test1(d: D): String {
|
||||
try {
|
||||
d.bar()
|
||||
} catch(ex: Throwable) {
|
||||
return "O"
|
||||
}
|
||||
|
||||
return "FAIL2"
|
||||
}
|
||||
|
||||
fun test2(d: D): String {
|
||||
return d.foo()
|
||||
}
|
||||
|
||||
|
||||
fun box(): String {
|
||||
return test1(D()) + test2(D())
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
@@ -0,0 +1,7 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
|
||||
STEP 1:
|
||||
libs: lib1
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
fun foo(): String = "FAIL1"
|
||||
|
||||
fun exp_foo() = "FAIL2"
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
fun foo(): String = "K"
|
||||
@@ -0,0 +1,6 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
STEP 1:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.1 -> l1.kt
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
fun qux(exp: Boolean): String = if (exp) exp_foo() else foo()
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
fun test1(): String {
|
||||
try {
|
||||
return qux(true)
|
||||
} catch(ex: Throwable) {
|
||||
return "O"
|
||||
}
|
||||
|
||||
return "FAIL2"
|
||||
}
|
||||
|
||||
fun test2(): String = qux(false)
|
||||
|
||||
fun box(): String {
|
||||
return test1() + test2()
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
@@ -0,0 +1,7 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
|
||||
STEP 1:
|
||||
libs: lib1
|
||||
@@ -47,6 +47,12 @@ fun main(args: Array<String>) {
|
||||
}
|
||||
}
|
||||
|
||||
testGroup("js/js.tests/tests-gen", "compiler/testData") {
|
||||
testClass<AbstractJsKLibABITestCase> {
|
||||
model("klibABI/", pattern = "^([^_](.+))$", targetBackend = TargetBackend.JS_IR, recursive = false, )
|
||||
}
|
||||
}
|
||||
|
||||
testGroup("js/js.tests/tests-gen", "js/js.translator/testData") {
|
||||
testClass<AbstractInvalidationTest> {
|
||||
model("incremental/invalidation/", pattern = "^([^_](.+))$", targetBackend = TargetBackend.JS_IR, recursive = false)
|
||||
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright 2010-2021 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.js.test;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
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/klibABI")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class JsKLibABITestCaseGenerated extends AbstractJsKLibABITestCase {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JS_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInKlibABI() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/klibABI"), Pattern.compile("^([^_](.+))$"), null, TargetBackend.JS_IR, false);
|
||||
}
|
||||
|
||||
@TestMetadata("removeClassAsParameterType")
|
||||
public void testRemoveClassAsParameterType() throws Exception {
|
||||
runTest("compiler/testData/klibABI/removeClassAsParameterType/");
|
||||
}
|
||||
|
||||
@TestMetadata("removeClassAsReturnType")
|
||||
public void testRemoveClassAsReturnType() throws Exception {
|
||||
runTest("compiler/testData/klibABI/removeClassAsReturnType/");
|
||||
}
|
||||
|
||||
@TestMetadata("removeClassAsSuperTypeArgument")
|
||||
public void testRemoveClassAsSuperTypeArgument() throws Exception {
|
||||
runTest("compiler/testData/klibABI/removeClassAsSuperTypeArgument/");
|
||||
}
|
||||
|
||||
@TestMetadata("removeClassAsTypeArgument")
|
||||
public void testRemoveClassAsTypeArgument() throws Exception {
|
||||
runTest("compiler/testData/klibABI/removeClassAsTypeArgument/");
|
||||
}
|
||||
|
||||
@TestMetadata("removeFunction")
|
||||
public void testRemoveFunction() throws Exception {
|
||||
runTest("compiler/testData/klibABI/removeFunction/");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user