Use ld_path for bitcode-build-tool
This commit is contained in:
committed by
Pavel Punegov
parent
c7c285bc27
commit
d7ca5bea71
@@ -134,18 +134,21 @@ open class FrameworkTest : DefaultTask() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun runTest(testExecutable: Path) {
|
private fun runTest(testExecutable: Path, args: List<String> = emptyList()) {
|
||||||
val executor = (project.convention.plugins["executor"] as? ExecutorService)
|
val executor = (project.convention.plugins["executor"] as? ExecutorService)
|
||||||
?: throw RuntimeException("Executor wasn't found")
|
?: throw RuntimeException("Executor wasn't found")
|
||||||
val (stdOut, stdErr, exitCode) = runProcess(
|
val (stdOut, stdErr, exitCode) = runProcess(
|
||||||
executor = executor.add(Action { it.environment = buildEnvironment() })::execute,
|
executor = executor.add(Action { it.environment = buildEnvironment() })::execute,
|
||||||
executable = testExecutable.toString())
|
executable = testExecutable.toString(),
|
||||||
|
args = args)
|
||||||
|
|
||||||
|
val testExecName = testExecutable.fileName
|
||||||
println("""
|
println("""
|
||||||
|
|$testExecName
|
||||||
|stdout: $stdOut
|
|stdout: $stdOut
|
||||||
|stderr: $stdErr
|
|stderr: $stdErr
|
||||||
""".trimMargin())
|
""".trimMargin())
|
||||||
check(exitCode == 0) { "Execution failed with exit code: $exitCode " }
|
check(exitCode == 0) { "Execution of $testExecName failed with exit code: $exitCode " }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun validateBitcodeEmbedding(frameworkBinary: String) {
|
private fun validateBitcodeEmbedding(frameworkBinary: String) {
|
||||||
@@ -156,7 +159,7 @@ open class FrameworkTest : DefaultTask() {
|
|||||||
val testTarget = project.testTarget
|
val testTarget = project.testTarget
|
||||||
val configurables = project.platformManager.platform(testTarget).configurables as AppleConfigurables
|
val configurables = project.platformManager.platform(testTarget).configurables as AppleConfigurables
|
||||||
|
|
||||||
val bitcodeBuildTool = "${configurables.absoluteAdditionalToolsDir}/bin/bitcode-build-tool"
|
val bitcodeBuildTool = Paths.get("${configurables.absoluteAdditionalToolsDir}/bin/bitcode-build-tool")
|
||||||
val ldPath = "${configurables.absoluteTargetToolchain}/usr/bin/ld"
|
val ldPath = "${configurables.absoluteTargetToolchain}/usr/bin/ld"
|
||||||
val sdk = when (testTarget) {
|
val sdk = when (testTarget) {
|
||||||
KonanTarget.IOS_X64,
|
KonanTarget.IOS_X64,
|
||||||
@@ -172,14 +175,6 @@ open class FrameworkTest : DefaultTask() {
|
|||||||
else -> error("Cannot validate bitcode for test target $testTarget")
|
else -> error("Cannot validate bitcode for test target $testTarget")
|
||||||
}
|
}
|
||||||
|
|
||||||
val args = listOf("--sdk", sdk, "-v", "-t", ldPath, frameworkBinary)
|
runTest(bitcodeBuildTool, args = listOf("--sdk", sdk, "-v", "-t", ldPath, frameworkBinary))
|
||||||
val (stdOut, stdErr, exitCode) = runProcess(executor = localExecutor(project), executable = bitcodeBuildTool, args = args)
|
|
||||||
check(exitCode == 0) {
|
|
||||||
"""
|
|
||||||
|bitcode-build-tool failed:
|
|
||||||
|stdout: $stdOut
|
|
||||||
|stderr: $stdErr
|
|
||||||
""".trimMargin()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user