Unify checks for iOS device in backend.native tests

This commit is contained in:
Sergey Bogolepov
2021-04-05 17:02:48 +07:00
committed by TeamCityServer
parent 316d62a72f
commit 7272e5dcad
4 changed files with 9 additions and 3 deletions
@@ -5251,7 +5251,7 @@ project.tasks.register("debugger_test", Test.class) {
}
// Configure build for iOS device targets.
if (target.family == Family.IOS && (target.architecture == ARM32 || target.architecture == ARM64)) {
if (UtilsKt.supportsRunningTestsOnDevice(target)) {
project.tasks
.withType(KonanTestExecutable.class)
.configureEach {
@@ -104,7 +104,7 @@ class ExecClang(private val project: Project) {
* 2. We call Clang from toolchain in case of Apple target.
*/
fun execClangForCompilerTests(target: KonanTarget, action: Action<in ExecSpec>): ExecResult {
val defaultArgs = platformManager.platform(target).clang.clangArgs
val defaultArgs = platformManager.platform(target).clang.clangArgs.toList()
return project.exec(Action<ExecSpec> {
action.execute(this)
executable = if (target.family.isAppleFamily) {
@@ -54,7 +54,7 @@ fun create(project: Project): ExecutorService {
configurables is WasmConfigurables -> wasmExecutor(project)
configurables is ConfigurablesWithEmulator && testTarget != HostManager.host -> emulatorExecutor(project, testTarget)
configurables.targetTriple.isSimulator -> simulator(project)
testTarget == KonanTarget.IOS_ARM32 || testTarget == KonanTarget.IOS_ARM64 -> deviceLauncher(project)
supportsRunningTestsOnDevice(testTarget) -> deviceLauncher(project)
else -> localExecutorService(project)
}
}
@@ -164,6 +164,12 @@ fun codesign(project: Project, path: String) {
fun isSimulatorTarget(project: Project, target: KonanTarget): Boolean =
project.platformManager.platform(target).targetTriple.isSimulator
/**
* Check that [target] is an Apple device.
*/
fun supportsRunningTestsOnDevice(target: KonanTarget): Boolean =
target == KonanTarget.IOS_ARM32 || target == KonanTarget.IOS_ARM64
/**
* Creates a list of file paths to be compiled from the given [compile] list with regard to [exclude] list.
*/