OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # ============================================================================== | 5 # ============================================================================== |
6 # TEST SETUP | 6 # TEST SETUP |
7 # ============================================================================== | 7 # ============================================================================== |
8 | 8 |
9 if (is_android) { | 9 if (is_android) { |
10 import("//build/config/android/config.gni") | 10 import("//build/config/android/config.gni") |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 210 |
211 # TODO(GYP_GONE): Delete this after we've converted everything to GN. | 211 # TODO(GYP_GONE): Delete this after we've converted everything to GN. |
212 # The _run targets exist only for compatibility w/ GYP. | 212 # The _run targets exist only for compatibility w/ GYP. |
213 group("${target_name}_apk_run") { | 213 group("${target_name}_apk_run") { |
214 testonly = true | 214 testonly = true |
215 deps = [ | 215 deps = [ |
216 ":${invoker.target_name}", | 216 ":${invoker.target_name}", |
217 ] | 217 ] |
218 } | 218 } |
219 } else if (is_ios) { | 219 } else if (is_ios) { |
| 220 import("//build/config/ios/ios_sdk.gni") |
220 import("//build/config/ios/rules.gni") | 221 import("//build/config/ios/rules.gni") |
221 | 222 |
222 _test_target = target_name | 223 _test_target = target_name |
223 _resources_bundle_data = target_name + "_resources_bundle_data" | 224 _resources_bundle_data = target_name + "_resources_bundle_data" |
224 | 225 |
225 bundle_data(_resources_bundle_data) { | 226 bundle_data(_resources_bundle_data) { |
226 visibility = [ ":$_test_target" ] | 227 visibility = [ ":$_test_target" ] |
227 sources = [ | 228 sources = [ |
228 "//testing/gtest_ios/Default.png", | 229 "//testing/gtest_ios/Default.png", |
229 ] | 230 ] |
230 outputs = [ | 231 outputs = [ |
231 "{{bundle_resources_dir}}/{{source_file_part}}", | 232 "{{bundle_resources_dir}}/{{source_file_part}}", |
232 ] | 233 ] |
233 } | 234 } |
234 | 235 |
235 ios_app_bundle(_test_target) { | 236 ios_app_bundle(_test_target) { |
236 testonly = true | 237 testonly = true |
237 | 238 |
238 # See above call. | 239 # See above call. |
239 set_sources_assignment_filter([]) | 240 set_sources_assignment_filter([]) |
240 forward_variables_from(invoker, "*", [ "testonly" ]) | 241 forward_variables_from(invoker, "*", [ "testonly" ]) |
241 | 242 |
242 # Provide sensible defaults in case invoker did not define any of those | 243 # Provide sensible defaults in case invoker did not define any of those |
243 # required variables. | 244 # required variables. |
244 if (!defined(info_plist) && !defined(info_plist_target)) { | 245 if (!defined(info_plist) && !defined(info_plist_target)) { |
245 info_plist = "//testing/gtest_ios/unittest-Info.plist" | 246 info_plist = "//testing/gtest_ios/unittest-Info.plist" |
246 } | 247 } |
247 | 248 |
248 _bundle_id_suffix = target_name | 249 _bundle_id_suffix = ios_generic_test_bundle_id_suffix |
249 if (ios_automatically_manage_certs) { | 250 if (!ios_automatically_manage_certs) { |
250 # Use the same bundle identifier for all unit tests when managing | 251 _bundle_id_suffix = "${target_name}" |
251 # certificates automatically as the number of free certs is limited. | |
252 _bundle_id_suffix = "generic-unit-test" | |
253 } | 252 } |
254 if (!defined(extra_substitutions)) { | 253 if (!defined(extra_substitutions)) { |
255 extra_substitutions = [] | 254 extra_substitutions = [] |
256 } | 255 } |
257 extra_substitutions += [ "GTEST_BUNDLE_ID_SUFFIX=$_bundle_id_suffix" ] | 256 extra_substitutions += [ "GTEST_BUNDLE_ID_SUFFIX=$_bundle_id_suffix" ] |
258 | 257 |
259 if (!defined(deps)) { | 258 if (!defined(deps)) { |
260 deps = [] | 259 deps = [] |
261 } | 260 } |
262 deps += [ | 261 deps += [ |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 } | 305 } |
307 | 306 |
308 # Test defaults. | 307 # Test defaults. |
309 set_defaults("test") { | 308 set_defaults("test") { |
310 if (is_android) { | 309 if (is_android) { |
311 configs = default_shared_library_configs | 310 configs = default_shared_library_configs |
312 } else { | 311 } else { |
313 configs = default_executable_configs | 312 configs = default_executable_configs |
314 } | 313 } |
315 } | 314 } |
OLD | NEW |