[K/N][Tests] Migrate first ObjC test with framework
^KT-61259
This commit is contained in:
+2
@@ -177,6 +177,7 @@ private class ExtTestDataFile(
|
||||
args += "-opt-in=kotlin.native.internal.InternalForKotlinNativeTests" // for ReflectionPackageName
|
||||
val freeCInteropArgs = structure.directives.listValues(FREE_CINTEROP_ARGS.name)
|
||||
.orEmpty().flatMap { it.split(" ") }
|
||||
.map { it.replace("\$generatedSourcesDir", testDataFileSettings.generatedSourcesDir.absolutePath) }
|
||||
return TestCompilerArgs(args, freeCInteropArgs, testDataFileSettings.assertionsMode)
|
||||
}
|
||||
|
||||
@@ -719,6 +720,7 @@ private class ExtTestDataFileStructureFactory(parentDisposable: Disposable) : Te
|
||||
|
||||
source.files.forEach { extTestFile ->
|
||||
val file = moduleDir.resolve(extTestFile.name)
|
||||
file.parentFile.mkdirs()
|
||||
file.writeText(extTestFile.text)
|
||||
process(destination, TestFile.createCommitted(file, destination))
|
||||
}
|
||||
|
||||
+3
-2
@@ -7,14 +7,15 @@ package org.jetbrains.kotlin.konan.test.blackbox.support.util
|
||||
|
||||
internal val Class<*>.sanitizedName: String get() = sanitize(name)
|
||||
|
||||
internal fun getSanitizedFileName(fileName: String): String = sanitize(fileName, allowDots = true)
|
||||
internal fun getSanitizedFileName(fileName: String): String = sanitize(fileName, allowDots = true, allowSlashes = true)
|
||||
|
||||
private fun sanitize(s: String, allowDots: Boolean = false) = buildString {
|
||||
private fun sanitize(s: String, allowDots: Boolean = false, allowSlashes: Boolean = false) = buildString {
|
||||
s.forEach { ch ->
|
||||
append(
|
||||
when {
|
||||
ch.isLetterOrDigit() || ch == '_' -> ch
|
||||
allowDots && ch == '.' -> ch
|
||||
allowSlashes && ch == '/' -> ch
|
||||
else -> '_'
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user