Skip to content

Commit

Permalink
[Test] Automatically infer common target platform for K1 MPP tests
Browse files Browse the repository at this point in the history
Previous changes made the TargetPlatform the same for all modules in the
test, but K1 expects for common modules in MPP hierarchy to be resolved
with common platform as a target platform.

This change fixed a lot of K1 diagnostic tests, as a lot of them didn't
set the target platform "properly" (with `TARGET_PLATFORM` directive or
with `-common` suffix in the module name), which is not a problem anymore
  • Loading branch information
demiurg906 authored and Space Cloud committed Jan 8, 2025
1 parent c86a7d4 commit 31fef31
Show file tree
Hide file tree
Showing 171 changed files with 223 additions and 4,981 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// MODULE: common
// FILE: common.kt
expect open class <!NO_ACTUAL_FOR_EXPECT!>Base<!>()
expect open class Base()

interface I {
fun foo(): String?
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// FIR_IDENTICAL
// LANGUAGE: +MultiPlatformProjects

// MODULE: common
// FILE: common.kt
expect class <!NO_ACTUAL_FOR_EXPECT!>A<!>() {}
expect class A() {}

// MODULE: jvm()()(common)
// FILE: J.java
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// FIR_IDENTICAL
// RUN_PIPELINE_TILL: FRONTEND
// ISSUE: KT-69463
// LANGUAGE: +MultiPlatformProjects

// MODULE: common
// FILE: common.kt
expect interface <!NO_ACTUAL_FOR_EXPECT!>Foo<!> {
expect interface Foo {
fun test(a: Int = 7)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

// MODULE: common
// FILE: Common.kt
expect abstract class <!NO_ACTUAL_FOR_EXPECT!>B<!>() {
expect abstract class B() {
open fun get(index: Int): Char
}

expect abstract class <!NO_ACTUAL_FOR_EXPECT!>KA<!> : B {
expect abstract class KA : B {
override fun get(index: Int): Char
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// FILE: common.kt
// TODO: .fir.kt version is just a stub.

expect interface My {
expect interface <!NO_ACTUAL_FOR_EXPECT!>My<!> {
open fun bar()
<!EXPECTED_DECLARATION_WITH_BODY!>open fun bas()<!> {}
<!REDUNDANT_MODIFIER!>open<!> abstract fun bat(): Int
Expand All @@ -28,7 +28,7 @@ class MyImpl2: My {
override val e = 1
}

expect interface Outer {
expect interface <!NO_ACTUAL_FOR_EXPECT!>Outer<!> {
interface Inner {
open fun bar()
<!EXPECTED_DECLARATION_WITH_BODY!>open fun bas()<!> {}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// FILE: common.kt
package pkg

expect open class <!NO_ACTUAL_FOR_EXPECT!>Foo<!> {
expect open class Foo {
protected fun foo()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// FILE: common.kt
package kotlin.collections

public expect abstract class <!NO_ACTUAL_FOR_EXPECT!>AbstractMutableList<!>() {
public expect abstract class AbstractMutableList() {
protected var modCount: Int
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// FILE: common.kt
package foo

public expect abstract class <!NO_ACTUAL_FOR_EXPECT!>AbstractMutableList<!>() {
public expect abstract class AbstractMutableList() {
protected var modCount: Int
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// MODULE: common
// FILE: common.kt
expect open class <!NO_ACTUAL_FOR_EXPECT!>AbstractMutableList<!> {
expect open class AbstractMutableList {
var modCount: Int
}

Expand Down

This file was deleted.

Loading

0 comments on commit 31fef31

Please sign in to comment.