Skip to content

Commit 5d68e88

Browse files
authored
fix(ios): fix for using DYLD_INSERT_LIBRARIES in xctestrunEnv (#900)
1 parent 6ec57df commit 5d68e88

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

vendor/vendor-ios/src/main/kotlin/com/malinskiy/marathon/ios/xctestrun/TestRootFactory.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,14 @@ class TestRootFactory(
8080
val userFrameworkPath =
8181
vendorConfiguration.xctestrunEnv["DYLD_FRAMEWORK_PATH"]?.split(":")?.filter { it.isNotBlank() } ?: emptySet()
8282
val userLibraryPath = vendorConfiguration.xctestrunEnv["DYLD_LIBRARY_PATH"]?.split(":")?.filter { it.isNotBlank() } ?: emptySet()
83+
val userInsertLibraries = vendorConfiguration.xctestrunEnv["DYLD_INSERT_LIBRARIES"]?.split(":")?.filter { it.isNotBlank() } ?: emptySet()
8384

8485
val dyldFrameworks = mutableListOf("__TESTROOT__", frameworks, privateFrameworks, *userFrameworkPath.toTypedArray())
8586
val dyldLibraries = listOf("__TESTROOT__", usrLib, *userLibraryPath.toTypedArray())
8687
val dyldInsertLibraries = if (useLibParseTests) {
87-
listOf(remoteFileManager.remoteXctestParserFile())
88+
listOf(remoteFileManager.remoteXctestParserFile(), *userInsertLibraries.toTypedArray())
8889
} else {
89-
emptyList()
90+
listOf(*userInsertLibraries.toTypedArray())
9091
}
9192

9293
/**
@@ -103,7 +104,7 @@ class TestRootFactory(
103104
"DYLD_INSERT_LIBRARIES" to dyldInsertLibraries.joinToString(":")
104105
).apply {
105106
vendorConfiguration.xctestrunEnv
106-
.filterKeys { !setOf("DYLD_FRAMEWORK_PATH", "DYLD_LIBRARY_PATH").contains(it) }
107+
.filterKeys { !setOf("DYLD_FRAMEWORK_PATH", "DYLD_LIBRARY_PATH", "DYLD_INSERT_LIBRARIES").contains(it) }
107108
.forEach {
108109
put(it.key, it.value)
109110
}

0 commit comments

Comments
 (0)