Skip to content

Commit

Permalink
fix(ios): fix for using DYLD_INSERT_LIBRARIES in xctestrunEnv (#900)
Browse files Browse the repository at this point in the history
  • Loading branch information
Malinskiy authored Feb 15, 2024
1 parent 6ec57df commit 5d68e88
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ class TestRootFactory(
val userFrameworkPath =
vendorConfiguration.xctestrunEnv["DYLD_FRAMEWORK_PATH"]?.split(":")?.filter { it.isNotBlank() } ?: emptySet()
val userLibraryPath = vendorConfiguration.xctestrunEnv["DYLD_LIBRARY_PATH"]?.split(":")?.filter { it.isNotBlank() } ?: emptySet()
val userInsertLibraries = vendorConfiguration.xctestrunEnv["DYLD_INSERT_LIBRARIES"]?.split(":")?.filter { it.isNotBlank() } ?: emptySet()

val dyldFrameworks = mutableListOf("__TESTROOT__", frameworks, privateFrameworks, *userFrameworkPath.toTypedArray())
val dyldLibraries = listOf("__TESTROOT__", usrLib, *userLibraryPath.toTypedArray())
val dyldInsertLibraries = if (useLibParseTests) {
listOf(remoteFileManager.remoteXctestParserFile())
listOf(remoteFileManager.remoteXctestParserFile(), *userInsertLibraries.toTypedArray())
} else {
emptyList()
listOf(*userInsertLibraries.toTypedArray())
}

/**
Expand All @@ -103,7 +104,7 @@ class TestRootFactory(
"DYLD_INSERT_LIBRARIES" to dyldInsertLibraries.joinToString(":")
).apply {
vendorConfiguration.xctestrunEnv
.filterKeys { !setOf("DYLD_FRAMEWORK_PATH", "DYLD_LIBRARY_PATH").contains(it) }
.filterKeys { !setOf("DYLD_FRAMEWORK_PATH", "DYLD_LIBRARY_PATH", "DYLD_INSERT_LIBRARIES").contains(it) }
.forEach {
put(it.key, it.value)
}
Expand Down

0 comments on commit 5d68e88

Please sign in to comment.