[Test] Update testdata of CompileKotlinAgainstCustomBinariesTest

This commit is contained in:
Dmitriy Novozhilov
2021-01-13 14:53:48 +03:00
parent 9b80a552e9
commit f3393eae1b
11 changed files with 63 additions and 76 deletions
@@ -1,25 +1,29 @@
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:2:5: warning: 'builder(suspend () -> Unit): Unit' is deprecated. Experimental coroutines support will be dropped in 1.4
warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:2:5: error: unresolved reference: builder
builder {}
^
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:3:5: warning: 'builder2(suspend Int.(String) -> Unit): Unit' is deprecated. Experimental coroutines support will be dropped in 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:3:5: error: unresolved reference: builder2
builder2 { }
^
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:6:7: warning: 'start(): Unit' is deprecated. Experimental coroutines support will be dropped in 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:6:7: error: unresolved reference: start
x.start()
^
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:8:5: warning: 'dummy(): Unit' is deprecated. Experimental coroutines support will be dropped in 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:8:5: error: unresolved reference: dummy
dummy()
^
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:9:9: warning: 'dummy(): String' is deprecated. Experimental coroutines support will be dropped in 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:9:5: error: unresolved reference: C
C().dummy()
^
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:10:25: warning: 'dummy(): String' is deprecated. Experimental coroutines support will be dropped in 1.4
^
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:10:5: error: unresolved reference: WithNested
WithNested.Nested().dummy()
^
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:11:25: warning: 'dummy(): String' is deprecated. Experimental coroutines support will be dropped in 1.4
^
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:11:5: error: unresolved reference: WithInner
WithInner().Inner().dummy()
^
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:13:5: warning: 'suspendAcceptsSuspend(suspend () -> Unit): Unit' is deprecated. Experimental coroutines support will be dropped in 1.4
^
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:13:5: error: unresolved reference: suspendAcceptsSuspend
suspendAcceptsSuspend {
^
OK
compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:14:9: error: suspension functions can be called only within coroutine body
callRelease()
^
COMPILATION_ERROR
@@ -35,7 +35,10 @@ compiler/testData/compileKotlinAgainstCustomBinaries/releaseCompilerAgainstPreRe
compiler/testData/compileKotlinAgainstCustomBinaries/releaseCompilerAgainstPreReleaseLibrary/source.kt:13:5: error: class 'a.AKt' is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler
bar = 239
^
compiler/testData/compileKotlinAgainstCustomBinaries/releaseCompilerAgainstPreReleaseLibrary/source.kt:13:5: error: class 'kotlin.Unit' is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler
bar = 239
^
compiler/testData/compileKotlinAgainstCustomBinaries/releaseCompilerAgainstPreReleaseLibrary/source.kt:14:12: error: class 'a.AKt' is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler
val z: TA = ""
^
COMPILATION_ERROR
COMPILATION_ERROR
@@ -1,37 +1,37 @@
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.4. This declaration is only supported since Kotlin 42.33
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.5. This declaration is only supported since Kotlin 42.33
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.5
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.5
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.4. This declaration is only supported since Kotlin 42.33
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.5. This declaration is only supported since Kotlin 42.33
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.5
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.5
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.4. This declaration is only supported since Kotlin 42.33
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.5. This declaration is only supported since Kotlin 42.33
f()
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.5
f()
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.5
f()
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.4. This declaration is only supported since Kotlin 42.33
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.5. This declaration is only supported since Kotlin 42.33
return p
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.5
return p
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.5
return p
^
COMPILATION_ERROR
@@ -1,7 +1,7 @@
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.5
fun test(a: Outer.Nested) {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.5
a.f()
^
COMPILATION_ERROR
@@ -1,7 +1,7 @@
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst13/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst13/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.5
fun test(a: Outer.Nested) {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst13/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst13/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.5
a.f()
^
COMPILATION_ERROR
@@ -1,7 +1,7 @@
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.5
fun test(a: Outer.Nested) {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.5
a.f()
^
COMPILATION_ERROR
@@ -1,7 +1,7 @@
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.5
fun test(a: Outer.Nested) {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.4
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.5
a.f()
^
COMPILATION_ERROR
@@ -4,9 +4,9 @@ compiler/testData/compileKotlinAgainstCustomBinaries/suspensionPointInMonitor/so
compiler/testData/compileKotlinAgainstCustomBinaries/suspensionPointInMonitor/source.kt:14:13: error: a suspension point at SourceKt$test$2.invokeSuspend(source.kt:17) is inside a critical section
builder {
^
compiler/testData/compileKotlinAgainstCustomBinaries/suspensionPointInMonitor/source.kt:24:9: error: a suspension point at SourceKt$test$3$invokeSuspend$$inlined$withCrossinline$2.invokeSuspend(source.kt:60) is inside a critical section
withCrossinline {
^
compiler/testData/compileKotlinAgainstCustomBinaries/suspensionPointInMonitor/source.kt:49:1: error: a suspension point at SourceKt$test$3$invokeSuspend$$inlined$withCrossinline$2.invokeSuspend(source.kt:60) is inside a critical section
inline fun withCrossinline(crossinline a: suspend () -> Unit): suspend () -> Unit {
^
compiler/testData/compileKotlinAgainstCustomBinaries/suspensionPointInMonitor/source.kt:50:34: error: a suspension point at SourceKt$withCrossinline$c$1.invokeSuspend(source.kt:52) is inside a critical section
val c : suspend () -> Unit = {
^
@@ -1,3 +1,4 @@
warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/warningsOnly_1_3.kt:8:9: warning: cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
inlineFunBase {}
^
@@ -131,7 +131,7 @@ abstract class AbstractKotlinCompilerIntegrationTest : TestCaseWithTmpdir() {
return destination
}
private fun normalizeOutput(output: Pair<String, ExitCode>): String {
protected fun normalizeOutput(output: Pair<String, ExitCode>): String {
return AbstractCliTest.getNormalizedCompilerOutput(output.first, output.second, testDataDirectory.path)
.replace(FileUtil.toSystemIndependentName(tmpdir.absolutePath), "\$TMP_DIR\$")
}
@@ -9,6 +9,7 @@ import com.intellij.openapi.util.io.FileUtil
import junit.framework.TestCase
import org.jetbrains.kotlin.cli.WrongBytecodeVersionTest
import org.jetbrains.kotlin.cli.common.CLICompiler
import org.jetbrains.kotlin.cli.common.ExitCode
import org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport
import org.jetbrains.kotlin.cli.common.messages.MessageRenderer
import org.jetbrains.kotlin.cli.common.messages.PrintingMessageCollector
@@ -382,7 +383,17 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration
}
fun testRequireKotlinInNestedClassesAgainst13() {
val library = compileLibrary("library", additionalOptions = listOf("-language-version", "1.3"))
val library = compileLibrary(
"library",
additionalOptions = listOf("-language-version", "1.3"),
checkKotlinOutput = { actual ->
assertEquals(
normalizeOutput(
"warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin\n" to ExitCode.OK
), actual
)
}
)
compileKotlin("source.kt", tmpdir, listOf(library))
}
@@ -543,43 +554,6 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration
compileKotlin("source.kt", tmpdir, listOf(library))
}
fun testReleaseCoroutineCallFromExperimental() {
val library = compileLibrary(
"library",
additionalOptions = listOf("-language-version", "1.3", "-api-version", "1.3"),
checkKotlinOutput = {}
)
compileKotlin(
"experimental.kt",
tmpdir,
listOf(library),
additionalOptions = listOf("-language-version", "1.2", "-Xskip-metadata-version-check")
)
}
fun testExperimentalCoroutineCallFromRelease() {
doTestExperimentalCoroutineCallFromRelease()
}
fun testExperimentalCoroutineCallFromReleaseWarnings() {
doTestExperimentalCoroutineCallFromRelease()
}
private fun doTestExperimentalCoroutineCallFromRelease() {
val library = compileLibrary(
"library",
additionalOptions = listOf("-language-version", "1.2"),
checkKotlinOutput = {},
extraClassPath = listOf(ForTestCompileRuntime.coroutinesCompatForTests())
)
compileKotlin(
"release.kt",
tmpdir,
listOf(library, ForTestCompileRuntime.coroutinesCompatForTests()),
additionalOptions = listOf("-language-version", "1.3", "-api-version", "1.3")
)
}
fun testInternalFromForeignModule() {
compileKotlin("source.kt", tmpdir, listOf(compileLibrary("library")))
}
@@ -601,7 +575,12 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration
fun testJvmDefaultCompatibilityAgainstJava() {
val library = compileLibrary("library", additionalOptions = listOf("-Xjvm-default=disable"))
compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-jvm-target", "1.8", "-Xjvm-default=all-compatibility"))
compileKotlin(
"source.kt",
tmpdir,
listOf(library),
additionalOptions = listOf("-jvm-target", "1.8", "-Xjvm-default=all-compatibility")
)
}
fun testInternalFromForeignModuleJs() {