[Test] Add CLI tests for platform checkers in MPP

^KT-58881
This commit is contained in:
Dmitriy Novozhilov
2024-01-10 15:50:23 +02:00
committed by Nikolay Lunyak
parent e8f5e35a86
commit b71797383f
6 changed files with 49 additions and 0 deletions
@@ -0,0 +1,13 @@
$TESTDATA_DIR$/../jvm/firMultiplatformCompilationWithError/common.kt
$TESTDATA_DIR$/../jvm/firMultiplatformCompilationWithError/jvm.kt
-Xcommon-sources
$TESTDATA_DIR$/../jvm/firMultiplatformCompilationWithError/common.kt
-language-version
2.0
-ir-output-dir
$TEMP_DIR$
-ir-output-name
firMultiplatformCompilationWithError
-XXLanguage\:+MultiPlatformProjects
-libraries
libraries/stdlib/build/classes/kotlin/js/main
@@ -0,0 +1,20 @@
warning: advanced option value is passed in an obsolete form. Please use the '=' character to specify the value: -Xcommon-sources=...
warning: ATTENTION!
This build uses unsafe internal compiler arguments:
-XXLanguage:+MultiPlatformProjects
This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
compiler/testData/cli/jvm/firMultiplatformCompilationWithError/common.kt:7:1: error: class 'CommonClass' is not abstract and does not implement abstract member 'foo'.
class CommonClass : B
^
compiler/testData/cli/jvm/firMultiplatformCompilationWithError/jvm.kt:1:18: error: 'actual interface A : Any' has no corresponding members for expected class members:
expect fun foo(): Unit
actual interface A
^
COMPILATION_ERROR
@@ -8,6 +8,9 @@ This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
compiler/testData/cli/jvm/firMultiplatformCompilationWithError/common.kt:7:1: error: class 'CommonClass' is not abstract and does not implement abstract member 'foo'.
class CommonClass : B
^
compiler/testData/cli/jvm/firMultiplatformCompilationWithError/jvm.kt:1:18: error: 'actual interface A : Any' has no corresponding members for expected class members:
expect fun foo(): Unit
@@ -1,3 +1,7 @@
expect interface A {
fun foo()
}
expect interface B
class CommonClass : B
@@ -1 +1,5 @@
actual interface A
actual interface B {
fun foo()
}