[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
@@ -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() {