Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(889)

Unified Diff: webrtc/test/BUILD.gn

Issue 2991323003: Decoupling test targets from Obj-C code (Closed)
Patch Set: Fixing BUILD.gn file after wrong merge Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/BUILD.gn
diff --git a/webrtc/test/BUILD.gn b/webrtc/test/BUILD.gn
index f5c0afde4197ede3cedf411ab3f22aac8b0d7e28..b7b2319858343f4e78233931c95181d54d46f66e 100644
--- a/webrtc/test/BUILD.gn
+++ b/webrtc/test/BUILD.gn
@@ -109,6 +109,17 @@ rtc_source_set("field_trial") {
]
}
+if (is_ios) {
+ rtc_source_set("test_support_objc") {
+ testonly = true
+ visibility = [ ":*" ]
+ sources = [
+ "ios/test_support.h",
+ "ios/test_support.mm",
+ ]
+ }
+}
+
rtc_source_set("test_support") {
testonly = true
@@ -124,11 +135,11 @@ rtc_source_set("test_support") {
"testsupport/unittest_utils.h",
]
+ public_deps = [
+ ":fileutils",
+ ]
if (is_ios) {
- sources += [
- "ios/test_support.h",
- "ios/test_support.mm",
- ]
+ public_deps += [ ":test_support_objc" ]
}
deps = [
@@ -141,10 +152,6 @@ rtc_source_set("test_support") {
"//testing/gtest",
]
- public_deps = [
- ":fileutils",
- ]
-
if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
@@ -343,8 +350,23 @@ if (!build_with_chromium) {
}
}
+if (is_ios) {
+ rtc_source_set("fileutils_objc") {
+ visibility = [ ":*" ]
+ sources = [
+ "testsupport/iosfileutils.mm",
+ ]
+ deps = [
+ "..:webrtc_common",
+ "../rtc_base:rtc_base_approved",
+ "../sdk:objc_common",
+ ]
+ }
+}
+
rtc_source_set("fileutils") {
testonly = true
+ visibility = [ ":*" ]
sources = [
"testsupport/fileutils.cc",
"testsupport/fileutils.h",
@@ -354,27 +376,58 @@ rtc_source_set("fileutils") {
"../rtc_base:rtc_base_approved",
]
if (is_ios) {
- sources += [ "testsupport/iosfileutils.mm" ]
- deps += [ "../sdk:objc_common" ]
+ deps += [ ":fileutils_objc" ]
}
if (is_win) {
deps += [ "../rtc_base:rtc_base" ]
}
- visibility = [ ":*" ]
}
rtc_source_set("run_test") {
testonly = true
+ if (is_mac) {
+ public_deps = [
+ ":run_test_objc",
+ ]
+ } else {
+ public_deps = [
+ ":run_test_generic",
+ ]
+ }
+}
+
+rtc_source_set("run_test_interface") {
+ testonly = true
+ visibility = [ ":*" ]
sources = [
"run_test.h",
]
- if (is_mac) {
- sources += [ "mac/run_test.mm" ]
- } else {
- sources += [ "run_test.cc" ]
+}
+
+if (is_mac) {
+ rtc_source_set("run_test_objc") {
+ testonly = true
+ visibility = [ ":*" ]
+ sources = [
+ "mac/run_test.mm",
+ ]
+ public_deps = [
+ ":run_test_interface",
+ ]
}
}
+rtc_source_set("run_test_generic") {
+ testonly = true
+ visibility = [ ":*" ]
+ sources = [
+ "run_test.cc",
+ ]
+ public_deps = [
+ ":run_test_interface",
+ ]
+}
+
rtc_source_set("fileutils_unittests") {
testonly = true
visibility = [ ":*" ] # Only targets in this file can depend on this.
@@ -543,18 +596,64 @@ config("test_renderer_exported_config") {
rtc_source_set("test_renderer") {
testonly = true
+ if (is_mac) {
+ public_deps = [
+ ":test_renderer_objc",
+ ]
+ } else {
+ public_deps = [
+ ":test_renderer_generic",
+ ]
+ }
+}
+
+if (is_mac) {
+ rtc_source_set("test_renderer_objc") {
+ testonly = true
+ visibility = [ ":*" ]
+ sources = [
+ "mac/video_renderer_mac.h",
+ "mac/video_renderer_mac.mm",
+ ]
+ public_deps = [
+ ":test_renderer_generic",
+ ]
+ deps = [
+ "../rtc_base:rtc_base_approved",
+ ]
+ libs = [
+ "Cocoa.framework",
+ "OpenGL.framework",
+ "CoreVideo.framework",
+ ]
+ if (!build_with_chromium && is_clang) {
+ # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
+ suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
+ }
+ }
+}
+
+rtc_source_set("test_renderer_generic") {
+ testonly = true
+ visibility = [ ":*" ]
libs = []
sources = [
"linux/glx_renderer.cc",
"linux/glx_renderer.h",
"linux/video_renderer_linux.cc",
- "mac/video_renderer_mac.h",
- "mac/video_renderer_mac.mm",
"video_renderer.cc",
"video_renderer.h",
"win/d3d_renderer.cc",
"win/d3d_renderer.h",
]
+ deps = [
+ ":test_support",
+ "..:webrtc_common",
+ "../common_video",
+ "../modules/media_file",
+ "../rtc_base:rtc_base_approved",
+ "//testing/gtest",
+ ]
if (!is_linux && !is_mac && !is_win) {
sources += [ "null_platform_renderer.cc" ]
}
@@ -578,13 +677,6 @@ rtc_source_set("test_renderer") {
"log",
]
}
- if (is_mac) {
- libs = [
- "Cocoa.framework",
- "OpenGL.framework",
- "CoreVideo.framework",
- ]
- }
public_configs = [ ":test_renderer_exported_config" ]
@@ -592,15 +684,6 @@ rtc_source_set("test_renderer") {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
-
- deps = [
- ":test_support",
- "..:webrtc_common",
- "../common_video",
- "../modules/media_file",
- "../rtc_base:rtc_base_approved",
- "//testing/gtest",
- ]
}
rtc_source_set("audio_codec_mocks") {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698