Minor, add a bit more tests for KT-12063

This commit is contained in:
Alexander Udalov
2021-03-31 00:07:00 +02:00
parent 66429cfb43
commit 1f7cef6f13
12 changed files with 238 additions and 23 deletions
@@ -23490,12 +23490,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/jvmStatic/companionObject.kt");
}
@Test
@TestMetadata("companionObjectProtected.kt")
public void testCompanionObjectProtected() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/companionObjectProtected.kt");
}
@Test
@TestMetadata("convention.kt")
public void testConvention() throws Exception {
@@ -23687,6 +23681,34 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
public void testSyntheticAccessor() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/syntheticAccessor.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass")
@TestDataPath("$PROJECT_ROOT")
public class ProtectedInSuperClass {
@Test
public void testAllFilesPresentInProtectedInSuperClass() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("defaultArguments.kt")
public void testDefaultArguments() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass/defaultArguments.kt");
}
@Test
@TestMetadata("simpleFunction.kt")
public void testSimpleFunction() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass/simpleFunction.kt");
}
@Test
@TestMetadata("simpleProperty.kt")
public void testSimpleProperty() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass/simpleProperty.kt");
}
}
}
@Nested
@@ -0,0 +1,20 @@
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: 1.kt
package a
open class A {
companion object {
@JvmStatic
protected fun foo(result: String = "OK"): String = result
}
}
// FILE: 2.kt
import a.*
class B : A() {
fun bar(): String = foo()
}
fun box() = B().bar()
@@ -0,0 +1,26 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM
// WITH_RUNTIME
// FILE: 1.kt
package a
open class A {
companion object {
@JvmStatic
@get:JvmStatic
@set:JvmStatic
protected var foo = "Fail"
}
}
// FILE: 2.kt
import a.*
class B : A() {
fun bar(): String {
foo = "OK"
return foo
}
}
fun box() = B().bar()
@@ -23472,12 +23472,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/jvmStatic/companionObject.kt");
}
@Test
@TestMetadata("companionObjectProtected.kt")
public void testCompanionObjectProtected() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/companionObjectProtected.kt");
}
@Test
@TestMetadata("convention.kt")
public void testConvention() throws Exception {
@@ -23669,6 +23663,34 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
public void testSyntheticAccessor() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/syntheticAccessor.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass")
@TestDataPath("$PROJECT_ROOT")
public class ProtectedInSuperClass {
@Test
public void testAllFilesPresentInProtectedInSuperClass() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@Test
@TestMetadata("defaultArguments.kt")
public void testDefaultArguments() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass/defaultArguments.kt");
}
@Test
@TestMetadata("simpleFunction.kt")
public void testSimpleFunction() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass/simpleFunction.kt");
}
@Test
@TestMetadata("simpleProperty.kt")
public void testSimpleProperty() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass/simpleProperty.kt");
}
}
}
@Nested
@@ -23490,12 +23490,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/jvmStatic/companionObject.kt");
}
@Test
@TestMetadata("companionObjectProtected.kt")
public void testCompanionObjectProtected() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/companionObjectProtected.kt");
}
@Test
@TestMetadata("convention.kt")
public void testConvention() throws Exception {
@@ -23687,6 +23681,34 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
public void testSyntheticAccessor() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/syntheticAccessor.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass")
@TestDataPath("$PROJECT_ROOT")
public class ProtectedInSuperClass {
@Test
public void testAllFilesPresentInProtectedInSuperClass() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("defaultArguments.kt")
public void testDefaultArguments() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass/defaultArguments.kt");
}
@Test
@TestMetadata("simpleFunction.kt")
public void testSimpleFunction() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass/simpleFunction.kt");
}
@Test
@TestMetadata("simpleProperty.kt")
public void testSimpleProperty() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass/simpleProperty.kt");
}
}
}
@Nested
@@ -19761,11 +19761,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class JvmStatic extends AbstractLightAnalysisModeTest {
@TestMetadata("companionObjectProtected.kt")
public void ignoreCompanionObjectProtected() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/companionObjectProtected.kt");
}
@TestMetadata("extensionPropertyGetter.kt")
public void ignoreExtensionPropertyGetter() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/extensionPropertyGetter.kt");
@@ -19948,6 +19943,34 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
public void testSyntheticAccessor() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/syntheticAccessor.kt");
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ProtectedInSuperClass extends AbstractLightAnalysisModeTest {
@TestMetadata("defaultArguments.kt")
public void ignoreDefaultArguments() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass/defaultArguments.kt");
}
@TestMetadata("simpleFunction.kt")
public void ignoreSimpleFunction() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass/simpleFunction.kt");
}
@TestMetadata("simpleProperty.kt")
public void ignoreSimpleProperty() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass/simpleProperty.kt");
}
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInProtectedInSuperClass() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
}
}
@TestMetadata("compiler/testData/codegen/box/labels")
@@ -23698,6 +23698,34 @@ public class VisualizerBlackBoxTestGenerated extends AbstractVisualizerBlackBoxT
public void testSyntheticAccessor() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/syntheticAccessor.kt");
}
@Nested
@TestMetadata("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass")
@TestDataPath("$PROJECT_ROOT")
public class ProtectedInSuperClass {
@Test
public void testAllFilesPresentInProtectedInSuperClass() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("defaultArguments.kt")
public void testDefaultArguments() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass/defaultArguments.kt");
}
@Test
@TestMetadata("simpleFunction.kt")
public void testSimpleFunction() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass/simpleFunction.kt");
}
@Test
@TestMetadata("simpleProperty.kt")
public void testSimpleProperty() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass/simpleProperty.kt");
}
}
}
@Nested
@@ -15612,6 +15612,19 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
public void testAllFilesPresentInJvmStatic() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ProtectedInSuperClass extends AbstractIrJsCodegenBoxES6Test {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
}
public void testAllFilesPresentInProtectedInSuperClass() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
}
}
@TestMetadata("compiler/testData/codegen/box/labels")
@@ -15033,6 +15033,19 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
public void testAllFilesPresentInJvmStatic() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ProtectedInSuperClass extends AbstractIrJsCodegenBoxTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
}
public void testAllFilesPresentInProtectedInSuperClass() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
}
}
@TestMetadata("compiler/testData/codegen/box/labels")
@@ -15098,6 +15098,19 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
public void testAllFilesPresentInJvmStatic() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ProtectedInSuperClass extends AbstractJsCodegenBoxTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
}
public void testAllFilesPresentInProtectedInSuperClass() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
}
}
}
@TestMetadata("compiler/testData/codegen/box/labels")
@@ -8979,6 +8979,19 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
public void testAllFilesPresentInJvmStatic() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ProtectedInSuperClass extends AbstractIrCodegenBoxWasmTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath);
}
public void testAllFilesPresentInProtectedInSuperClass() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic/protectedInSuperClass"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
}
}
}
@TestMetadata("compiler/testData/codegen/box/labels")