[Tests] Support language features from test data in .knm meta compiler
Mute test failure revealed by unblocked context receivers (KTIJ-28885) KTIJ-28668
This commit is contained in:
committed by
Space Team
parent
d17044515f
commit
00faa6fa01
+7
@@ -22,6 +22,7 @@ import java.nio.file.Paths
|
||||
import java.util.stream.Collectors
|
||||
import kotlin.io.path.absolutePathString
|
||||
import kotlin.io.path.extension
|
||||
import kotlin.io.path.readText
|
||||
|
||||
abstract class AbstractDecompiledKnmFileTest : KotlinTestWithEnvironment() {
|
||||
abstract val knmTestSupport: KnmTestSupport
|
||||
@@ -60,10 +61,16 @@ abstract class AbstractDecompiledKnmFileTest : KotlinTestWithEnvironment() {
|
||||
private fun compileCommonKlib(testDirectory: Path): File {
|
||||
val ktFiles = Files.list(testDirectory).filter { it.extension == "kt" }.collect(Collectors.toList())
|
||||
val testKlib = KtTestUtil.tmpDir("testLibrary").resolve("library.klib")
|
||||
val additionalArgumentsFromLanguageDirectives = ktFiles.flatMap { path ->
|
||||
path.readText().let { fileText ->
|
||||
InTextDirectivesUtils.findListWithPrefixes(fileText, "// !LANGUAGE: ").map { "-XXLanguage:$it" }
|
||||
}
|
||||
}
|
||||
KlibTestUtil.compileCommonSourcesToKlib(
|
||||
ktFiles.map(Path::toFile),
|
||||
libraryName = "library",
|
||||
testKlib,
|
||||
additionalArgumentsFromLanguageDirectives,
|
||||
)
|
||||
|
||||
return testKlib
|
||||
|
||||
-3
@@ -1,8 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
/* Unsupported arguments in test metadata compiler */
|
||||
// KNM_K2_IGNORE
|
||||
// KNM_FE10_IGNORE
|
||||
|
||||
private open class ContextReceiversCallableMembers {
|
||||
context(A, B)
|
||||
|
||||
-3
@@ -1,8 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
/* Unsupported arguments in test metadata compiler */
|
||||
// KNM_K2_IGNORE
|
||||
// KNM_FE10_IGNORE
|
||||
|
||||
context(A, B)
|
||||
private open class ContextReceiversOnClass {
|
||||
|
||||
+1
-2
@@ -1,9 +1,8 @@
|
||||
// FIR_IDENTICAL
|
||||
// JVM_FILE_NAME: ContextReceiversOnFunctionTypeKt
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
/* Unsupported arguments in test metadata compiler */
|
||||
/* KTIJ-28885 */
|
||||
// KNM_K2_IGNORE
|
||||
// KNM_FE10_IGNORE
|
||||
|
||||
fun f(g: context(A, B) Int.(Int) -> Int) {}
|
||||
|
||||
|
||||
-3
@@ -1,9 +1,6 @@
|
||||
// FIR_IDENTICAL
|
||||
// JVM_FILE_NAME: ContextReceiversOnTopLevelCallablesKt
|
||||
// !LANGUAGE: +ContextReceivers
|
||||
/* Unsupported arguments in test metadata compiler */
|
||||
// KNM_K2_IGNORE
|
||||
// KNM_FE10_IGNORE
|
||||
|
||||
context(A, B)
|
||||
private fun Int.function(): Int = valueA + valueB
|
||||
|
||||
Reference in New Issue
Block a user