1# Copyright 2021 The Chromium Authors 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import("//build/config/ios/ios_test_runner_wrapper.gni") 6import("//build/config/ios/rules.gni") 7 8# ios_test_runner_xcuitest are just ios_xcuitest_test with an 9# ios_test_runner_wrapper. Currently used by Crashpad tests, which do not depend 10# on EG2 (and therefore do not use ios_eg2_test) 11template("ios_test_runner_xcuitest") { 12 assert(defined(invoker.xcode_test_application_name), 13 "xcode_test_application_name must be defined for $target_name") 14 assert( 15 defined(invoker.deps), 16 "deps must be defined for $target_name to include at least one xctest" + 17 "file.") 18 19 _target_name = target_name 20 _test_target = "${target_name}_test" 21 ios_xcuitest_test(_test_target) { 22 forward_variables_from(invoker, 23 [ 24 "xcode_test_application_name", 25 "xctest_bundle_principal_class", 26 "bundle_deps", 27 "deps", 28 "data_deps", 29 ]) 30 31 # TODO(crbug.com/1056328) Because we change the target name, the subnodes 32 # are going to append with the _test in the naming, which won't be backwards 33 # compatible during migration from iOS recipe to Chromium. 34 output_name = "${_target_name}" 35 } 36 37 ios_test_runner_wrapper(target_name) { 38 forward_variables_from(invoker, 39 [ 40 "clones", 41 "data", 42 "data_deps", 43 "deps", 44 "executable_args", 45 "retries", 46 47 # TODO(crbug.com/1500395) deprecate shards 48 "shards", 49 "xcode_test_application_name", 50 ]) 51 _root_build_dir = rebase_path("${root_build_dir}", root_build_dir) 52 53 if (!defined(data_deps)) { 54 data_deps = [] 55 } 56 57 # Include the top ios_test_runner_xcuitest target, and the host app 58 data_deps += [ ":${_test_target}" ] 59 60 if (!defined(executable_args)) { 61 executable_args = [] 62 } 63 64 # The xcuitest module is bundled as *-Runner.app, while the host app is 65 # bundled as *.app. 66 executable_args += [ 67 "--app", 68 "@WrappedPath(${_root_build_dir}/${target_name}-Runner.app)", 69 ] 70 executable_args += [ 71 "--host-app", 72 "@WrappedPath(${_root_build_dir}/${xcode_test_application_name}.app)", 73 ] 74 } 75} 76