[Test] Add diagnostics and codegen tests with hmpp module structure

This commit is contained in:
Dmitriy Novozhilov
2021-05-13 15:23:12 +03:00
committed by TeamCityServer
parent 73a63359df
commit e08df2c530
18 changed files with 450 additions and 0 deletions
@@ -18633,6 +18633,28 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/hmpp")
@TestDataPath("$PROJECT_ROOT")
public class Hmpp {
@Test
public void testAllFilesPresentInHmpp() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/hmpp"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("sealedInheritorsInComplexModuleStructure.kt")
public void testSealedInheritorsInComplexModuleStructure() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/sealedInheritorsInComplexModuleStructure.kt");
}
@Test
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/simple.kt");
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/inlineClasses")
@TestDataPath("$PROJECT_ROOT")
@@ -18633,6 +18633,28 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/hmpp")
@TestDataPath("$PROJECT_ROOT")
public class Hmpp {
@Test
public void testAllFilesPresentInHmpp() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/hmpp"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("sealedInheritorsInComplexModuleStructure.kt")
public void testSealedInheritorsInComplexModuleStructure() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/sealedInheritorsInComplexModuleStructure.kt");
}
@Test
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/simple.kt");
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/inlineClasses")
@TestDataPath("$PROJECT_ROOT")
@@ -25958,6 +25958,22 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/multiplatform/hmpp")
@TestDataPath("$PROJECT_ROOT")
public class Hmpp {
@Test
public void testAllFilesPresentInHmpp() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/hmpp"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/box/multiplatform/hmpp/simple.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/multiplatform/multiModule")
@TestDataPath("$PROJECT_ROOT")
@@ -0,0 +1,36 @@
/*
* This test is used for general testing of how compiler BB tests for HMPP projects works
* Js backend is ignored because they use old test infrastructure which doesn't support HMPP
*/
// !LANGUAGE: +MultiPlatformProjects
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// MODULE: common
// TARGET_PLATFORM: Common
// FILE: common.kt
expect open class A()
// MODULE: intermediate()()(common)
// TARGET_PLATFORM: JVM, JS
// FILE: intermediate.kt
class B : A() {
fun foo(): String = "O"
}
fun getB(): B = B()
// MODULE: main()()(intermediate)
// FILE: main.kt
actual open class A actual constructor() {
fun bar(): String = "K"
}
fun box(): String {
val b = getB()
return b.foo() + b.bar()
}
@@ -0,0 +1,22 @@
// !LANGUAGE: +MultiPlatformProjects
// MODULE: common
// TARGET_PLATFORM: Common
package foo
expect sealed class SealedWithSharedActual()
expect sealed class SealedWithPlatformActuals : SealedWithSharedActual
// MODULE: intermediate()()(common)
// TARGET_PLATFORM: Common
package foo
actual sealed class SealedWithSharedActual
class SimpleShared : SealedWithPlatformActuals()
// MODULE: main()()(intermediate)
// TARGET_PLATFORM: JVM
package foo
actual sealed class SealedWithPlatformActuals <!NON_PRIVATE_OR_PROTECTED_CONSTRUCTOR_IN_SEALED!>actual constructor()<!>: SealedWithSharedActual()
@@ -0,0 +1,22 @@
// !LANGUAGE: +MultiPlatformProjects
// MODULE: common
// TARGET_PLATFORM: Common
package foo
expect sealed class SealedWithSharedActual()
expect sealed class SealedWithPlatformActuals : SealedWithSharedActual
// MODULE: intermediate()()(common)
// TARGET_PLATFORM: Common
package foo
actual sealed class SealedWithSharedActual
class SimpleShared : SealedWithPlatformActuals<!NO_CONSTRUCTOR!>()<!>
// MODULE: main()()(intermediate)
// TARGET_PLATFORM: JVM
package foo
actual sealed class SealedWithPlatformActuals <!ACTUAL_WITHOUT_EXPECT!>actual constructor()<!>: <!SEALED_INHERITOR_IN_DIFFERENT_MODULE!>SealedWithSharedActual<!>()
@@ -0,0 +1,79 @@
// -- Module: <common> --
package
package foo {
public sealed expect class SealedWithPlatformActuals : foo.SealedWithSharedActual {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public sealed expect class SealedWithSharedActual {
protected constructor SealedWithSharedActual()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
// -- Module: <intermediate> --
package
package foo {
public sealed expect class SealedWithPlatformActuals : foo.SealedWithSharedActual {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public sealed actual class SealedWithSharedActual {
protected constructor SealedWithSharedActual()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public sealed expect class SealedWithSharedActual {
protected constructor SealedWithSharedActual()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class SimpleShared : foo.SealedWithPlatformActuals {
public constructor SimpleShared()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
// -- Module: <main> --
package
package foo {
public sealed actual class SealedWithPlatformActuals : foo.SealedWithSharedActual {
protected constructor SealedWithPlatformActuals()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public sealed actual class SealedWithSharedActual {
protected constructor SealedWithSharedActual()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class SimpleShared : foo.SealedWithPlatformActuals {
public constructor SimpleShared()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
@@ -0,0 +1,32 @@
// FIR_IDENTICAL
/*
* This test is used for general testing of how compiler diagnostics tests for HMPP projects works
* Js backend is ignored because they use old test infrastructure which doesn't support HMPP
*/
// !LANGUAGE: +MultiPlatformProjects
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// MODULE: common
// TARGET_PLATFORM: Common
expect open class A()
// MODULE: intermediate()()(common)
// TARGET_PLATFORM: Common
class B : A() {
fun foo(): String = "O"
}
fun getB(): B = B()
// MODULE: main()()(intermediate)
actual open class A actual constructor() {
fun bar(): String = "K"
}
fun box(): String {
val b = getB()
return b.foo() + b.bar()
}
@@ -0,0 +1,52 @@
// -- Module: <common> --
package
public open expect class A {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
// -- Module: <intermediate> --
package
public fun getB(): B
public open expect class A {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class B : A {
public constructor B()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final fun foo(): kotlin.String
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
// -- Module: <main> --
package
public fun box(): kotlin.String
public fun getB(): B
public open actual class A {
public constructor A()
public final fun bar(): kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class B : A {
public constructor B()
public final override /*1*/ /*fake_override*/ fun bar(): kotlin.String
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final fun foo(): kotlin.String
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -18639,6 +18639,28 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/hmpp")
@TestDataPath("$PROJECT_ROOT")
public class Hmpp {
@Test
public void testAllFilesPresentInHmpp() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/hmpp"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("sealedInheritorsInComplexModuleStructure.kt")
public void testSealedInheritorsInComplexModuleStructure() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/sealedInheritorsInComplexModuleStructure.kt");
}
@Test
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/simple.kt");
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/inlineClasses")
@TestDataPath("$PROJECT_ROOT")
@@ -25934,6 +25934,22 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/multiplatform/hmpp")
@TestDataPath("$PROJECT_ROOT")
public class Hmpp {
@Test
public void testAllFilesPresentInHmpp() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/hmpp"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@Test
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/box/multiplatform/hmpp/simple.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/multiplatform/multiModule")
@TestDataPath("$PROJECT_ROOT")
@@ -25958,6 +25958,22 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/multiplatform/hmpp")
@TestDataPath("$PROJECT_ROOT")
public class Hmpp {
@Test
public void testAllFilesPresentInHmpp() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/hmpp"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/box/multiplatform/hmpp/simple.kt");
}
}
@Nested
@TestMetadata("compiler/testData/codegen/box/multiplatform/multiModule")
@TestDataPath("$PROJECT_ROOT")
@@ -21951,6 +21951,24 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
}
}
@TestMetadata("compiler/testData/codegen/box/multiplatform/hmpp")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Hmpp extends AbstractLightAnalysisModeTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInHmpp() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/hmpp"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/box/multiplatform/hmpp/simple.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/multiplatform/multiModule")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -16316,6 +16316,29 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
}
}
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/hmpp")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Hmpp extends AbstractDiagnosisCompilerTestDataTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInHmpp() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/hmpp"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("sealedInheritorsInComplexModuleStructure.kt")
public void testSealedInheritorsInComplexModuleStructure() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/sealedInheritorsInComplexModuleStructure.kt");
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/hmpp/simple.kt");
}
}
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/inlineClasses")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -17205,6 +17205,19 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes
}
}
@TestMetadata("compiler/testData/codegen/box/multiplatform/hmpp")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Hmpp extends AbstractIrJsCodegenBoxES6Test {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath);
}
public void testAllFilesPresentInHmpp() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/hmpp"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
}
}
@TestMetadata("compiler/testData/codegen/box/multiplatform/multiModule")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -16611,6 +16611,19 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
}
}
@TestMetadata("compiler/testData/codegen/box/multiplatform/hmpp")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Hmpp extends AbstractIrJsCodegenBoxTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
}
public void testAllFilesPresentInHmpp() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/hmpp"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
}
}
@TestMetadata("compiler/testData/codegen/box/multiplatform/multiModule")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -16676,6 +16676,19 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
}
}
@TestMetadata("compiler/testData/codegen/box/multiplatform/hmpp")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Hmpp extends AbstractJsCodegenBoxTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
}
public void testAllFilesPresentInHmpp() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/hmpp"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
}
}
@TestMetadata("compiler/testData/codegen/box/multiplatform/multiModule")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -10301,6 +10301,19 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
}
}
@TestMetadata("compiler/testData/codegen/box/multiplatform/hmpp")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Hmpp extends AbstractIrCodegenBoxWasmTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath);
}
public void testAllFilesPresentInHmpp() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/multiplatform/hmpp"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
}
}
@TestMetadata("compiler/testData/codegen/box/multiplatform/multiModule")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)