[K/N] Support also MM files in new native test infra
^KT-61259
This commit is contained in:
committed by
Space Team
parent
c09e8909d4
commit
dc2ea15dee
+5
-1
@@ -215,6 +215,10 @@ internal enum class MutedOption {
|
|||||||
K2
|
K2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal val CINTEROP_SOURCE_EXTENSIONS = setOf("c", "cpp", "m", "mm")
|
||||||
|
internal val CINTEROP_DEFINITION_EXTENSIONS = setOf("def", "h")
|
||||||
|
internal val KNOWN_EXTENSIONS = setOf("kt") + CINTEROP_DEFINITION_EXTENSIONS + CINTEROP_SOURCE_EXTENSIONS
|
||||||
|
|
||||||
internal class TestCInteropArgs(cinteropArgs: List<String>) : TestCompilerArgs(emptyList(), cinteropArgs) {
|
internal class TestCInteropArgs(cinteropArgs: List<String>) : TestCompilerArgs(emptyList(), cinteropArgs) {
|
||||||
constructor(vararg cinteropArgs: String) : this(cinteropArgs.asList())
|
constructor(vararg cinteropArgs: String) : this(cinteropArgs.asList())
|
||||||
}
|
}
|
||||||
@@ -344,7 +348,7 @@ internal fun parseFileName(parsedDirective: RegisteredDirectivesParser.ParsedDir
|
|||||||
}
|
}
|
||||||
|
|
||||||
val fileExtension = fileName.split(".").last()
|
val fileExtension = fileName.split(".").last()
|
||||||
if (fileExtension in setOf("kt", "def", "h", "c", "cpp", "m"))
|
if (fileExtension in KNOWN_EXTENSIONS)
|
||||||
assertTrue(fileName.length > 3 && '/' !in fileName && '\\' !in fileName) {
|
assertTrue(fileName.length > 3 && '/' !in fileName && '\\' !in fileName) {
|
||||||
"$location: Invalid file name with extension $fileExtension in ${parsedDirective.directive} directive: $fileName"
|
"$location: Invalid file name with extension $fileExtension in ${parsedDirective.directive} directive: $fileName"
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.konan.test.blackbox.support.compilation
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.container.topologicalSort
|
import org.jetbrains.kotlin.container.topologicalSort
|
||||||
import org.jetbrains.kotlin.konan.test.blackbox.muteCInteropTestIfNecessary
|
import org.jetbrains.kotlin.konan.test.blackbox.muteCInteropTestIfNecessary
|
||||||
|
import org.jetbrains.kotlin.konan.test.blackbox.support.CINTEROP_SOURCE_EXTENSIONS
|
||||||
import org.jetbrains.kotlin.konan.test.blackbox.support.PackageName
|
import org.jetbrains.kotlin.konan.test.blackbox.support.PackageName
|
||||||
import org.jetbrains.kotlin.konan.test.blackbox.support.TestCase
|
import org.jetbrains.kotlin.konan.test.blackbox.support.TestCase
|
||||||
import org.jetbrains.kotlin.konan.test.blackbox.support.TestCase.*
|
import org.jetbrains.kotlin.konan.test.blackbox.support.TestCase.*
|
||||||
@@ -216,7 +217,7 @@ internal class TestCompilationFactory {
|
|||||||
muteCInteropTestIfNecessary(defFile, settings.get<KotlinNativeTargets>().testTarget)
|
muteCInteropTestIfNecessary(defFile, settings.get<KotlinNativeTargets>().testTarget)
|
||||||
|
|
||||||
val cSourceFiles = buildList {
|
val cSourceFiles = buildList {
|
||||||
for (ext in listOf("cpp", "c", "m")) {
|
for (ext in CINTEROP_SOURCE_EXTENSIONS) {
|
||||||
filesByExtension[ext]?.let { addAll(it) }
|
filesByExtension[ext]?.let { addAll(it) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user