From aef8a21a695c099faea26a5748f45b2d136258bc Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Wed, 16 Sep 2020 15:09:53 +0200 Subject: [PATCH] Reland "Switch from rtc_ios_xctest_test to rtc_test". This is a reland of https://webrtc-review.googlesource.com/c/src/+/182680, and it is based on https://chromium-review.googlesource.com/c/chromium/src/+/2414169 which allows to force a "test" to be executed as an XCtest on a build target basis instead of on a GN args basis like it was happening in https://webrtc-review.googlesource.com/c/src/+/182680 because that was causing issues when launching tests on real devices. Bug: webrtc:11881, webrtc:11937 Change-Id: I4bec7f471cd0f878b6050f266cd0cca3b518d415 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184360 Reviewed-by: Dirk Pranke Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#32126} --- examples/BUILD.gn | 3 ++- sdk/BUILD.gn | 8 +++++--- webrtc.gni | 29 ----------------------------- 3 files changed, 7 insertions(+), 33 deletions(-) diff --git a/examples/BUILD.gn b/examples/BUILD.gn index 557e31fce5..c9dde6c506 100644 --- a/examples/BUILD.gn +++ b/examples/BUILD.gn @@ -632,7 +632,8 @@ if (is_ios || (is_mac && target_cpu != "x86")) { ] } - rtc_ios_xctest_test("apprtcmobile_tests") { + rtc_test("apprtcmobile_tests") { + is_xctest = true info_plist = "objc/AppRTCMobile/ios/Info.plist" sources = [ "objc/AppRTCMobile/tests/main.mm" ] deps = [ diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn index c87dcbe421..289536e732 100644 --- a/sdk/BUILD.gn +++ b/sdk/BUILD.gn @@ -1165,7 +1165,8 @@ if (is_ios || is_mac) { } # These tests use static linking. - rtc_ios_xctest_test("sdk_unittests") { + rtc_test("sdk_unittests") { + is_xctest = true info_plist = "//test/ios/Info.plist" sources = [ "objc/unittests/main.mm" ] @@ -1181,7 +1182,8 @@ if (is_ios || is_mac) { } # These tests link to the framework. - rtc_ios_xctest_test("sdk_framework_unittests") { + rtc_test("sdk_framework_unittests") { + is_xctest = true info_plist = "//test/ios/Info.plist" sources = [ "objc/unittests/RTCDoNotPutCPlusPlusInFrameworkHeaders_xctest.m", @@ -1669,8 +1671,8 @@ if (is_ios || is_mac) { rtc_library("video_toolbox_cc") { visibility = [ - ":videotoolbox_objc", ":sdk_unittests_sources", + ":videotoolbox_objc", ] sources = [ "objc/components/video_codec/helpers.cc", diff --git a/webrtc.gni b/webrtc.gni index 3081618cbf..a465f4901c 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -878,35 +878,6 @@ template("rtc_shared_library") { } if (is_ios) { - set_defaults("rtc_ios_xctest_test") { - configs = rtc_add_configs - suppressed_configs = [] - } - - template("rtc_ios_xctest_test") { - ios_xctest_test(target_name) { - forward_variables_from(invoker, - "*", - [ - "configs", - "public_configs", - "suppressed_configs", - "visibility", - ]) - forward_variables_from(invoker, [ "visibility" ]) - if (!defined(visibility)) { - visibility = webrtc_default_visibility - } - configs += invoker.configs - configs -= rtc_remove_configs - configs -= invoker.suppressed_configs - public_configs = [ rtc_common_inherited_config ] - if (defined(invoker.public_configs)) { - public_configs += invoker.public_configs - } - } - } - # TODO: Generate module.modulemap file to enable use in Swift # projects. See "mac_framework_bundle_with_umbrella_header". template("ios_framework_bundle_with_umbrella_header") {