Fix running Swift tests on macOS >= 10.14.4. (#2836)

This commit is contained in:
Nikolay Igotti
2019-04-01 12:43:10 +03:00
committed by GitHub
parent c1f4de7c29
commit 1baba6f054
@@ -97,8 +97,10 @@ open class FrameworkTest : DefaultTask() {
val libraryPath = configs.absoluteTargetToolchain + "/usr/lib/swift/$swiftPlatform"
val executor = (project.convention.plugins["executor"] as? ExecutorService)
?: throw RuntimeException("Executor wasn't found")
// Hopefully, lexicographical comparison will work.
val newMacos = System.getProperty("os.version").compareTo("10.14.4") >= 0
val (stdOut, stdErr, exitCode) = runProcess(
executor = executor.add(Action { it.environment = mapOf("DYLD_LIBRARY_PATH" to libraryPath) })::execute,
executor = executor.add(Action { it.environment = if (newMacos) emptyMap() else mapOf("DYLD_LIBRARY_PATH" to libraryPath) })::execute,
executable = testExecutable.toString())
println("""