blob: 14804486983bd3a72b4fccde9d55aee10307fdbe [file] [log] [blame]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +00001# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../webrtc.gni")
kjellander0f380d82016-06-01 04:48:26 -070010import("//build/config/ui.gni")
kjellander0f380d82016-06-01 04:48:26 -070011if (is_android) {
12 import("//build/config/android/rules.gni")
13}
ehmaldonadoed8c8ed2016-11-23 12:58:35 -080014if (rtc_use_memcheck) {
Henrik Kjellander90fd7d82017-05-09 08:30:10 +020015 import("//tools_webrtc/valgrind/valgrind-webrtc.gni")
ehmaldonadoed8c8ed2016-11-23 12:58:35 -080016}
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000017
kjellanderb62dbbe2016-09-23 00:38:52 -070018group("test") {
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000019 testonly = true
20
21 deps = [
22 ":field_trial",
kjellander0f380d82016-06-01 04:48:26 -070023 ":rtp_test_utils",
24 ":test_common",
25 ":test_renderer",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000026 ":test_support",
kjellander0f380d82016-06-01 04:48:26 -070027 ":video_test_common",
28 ]
mbonadei148d5a22017-04-28 05:24:50 -070029
30 if (!build_with_chromium) {
31 deps += [
32 ":test_main",
33 ":test_support_unittests",
34 ]
35 }
kjellander0f380d82016-06-01 04:48:26 -070036}
37
ehmaldonado38a21322016-09-02 04:10:34 -070038rtc_source_set("video_test_common") {
kjellander0f380d82016-06-01 04:48:26 -070039 testonly = true
40 sources = [
41 "fake_texture_frame.cc",
42 "fake_texture_frame.h",
43 "frame_generator.cc",
44 "frame_generator.h",
ehmaldonado656610f2017-02-06 02:21:11 -080045 "frame_generator_capturer.cc",
46 "frame_generator_capturer.h",
kjellander0f380d82016-06-01 04:48:26 -070047 "frame_utils.cc",
48 "frame_utils.h",
ehmaldonado656610f2017-02-06 02:21:11 -080049 "vcm_capturer.cc",
50 "vcm_capturer.h",
sprangc5d62e22017-04-02 23:53:04 -070051 "video_capturer.cc",
ehmaldonado656610f2017-02-06 02:21:11 -080052 "video_capturer.h",
mflodman351424e2017-08-10 02:43:14 -070053 "video_codec_settings.h",
kjellander0f380d82016-06-01 04:48:26 -070054 ]
55
kjellandere40a7ee2016-10-16 23:56:12 -070056 if (!build_with_chromium && is_clang) {
57 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070058 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -070059 }
60
61 deps = [
mbonadei3edccb92017-06-01 04:47:20 -070062 "..:webrtc_common",
mflodman351424e2017-08-10 02:43:14 -070063 "../api/video_codecs:video_codecs_api",
aleloi440b6d92017-08-22 05:43:23 -070064 "../call:video_stream_api",
kjellander0f380d82016-06-01 04:48:26 -070065 "../common_video",
sprangc5d62e22017-04-02 23:53:04 -070066 "../media:rtc_media_base",
ehmaldonado656610f2017-02-06 02:21:11 -080067 "../modules/video_capture:video_capture_module",
ehmaldonadof6a861a2017-07-19 10:40:47 -070068 "../rtc_base:rtc_base_approved",
69 "../rtc_base:rtc_task_queue",
mbonadei3edccb92017-06-01 04:47:20 -070070 "../system_wrappers",
kjellander0f380d82016-06-01 04:48:26 -070071 ]
72}
73
ehmaldonado38a21322016-09-02 04:10:34 -070074rtc_source_set("rtp_test_utils") {
kjellander0f380d82016-06-01 04:48:26 -070075 testonly = true
76 sources = [
77 "rtcp_packet_parser.cc",
78 "rtcp_packet_parser.h",
79 "rtp_file_reader.cc",
80 "rtp_file_reader.h",
81 "rtp_file_writer.cc",
82 "rtp_file_writer.h",
83 ]
84
kjellandere40a7ee2016-10-16 23:56:12 -070085 if (!build_with_chromium && is_clang) {
86 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070087 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -070088 }
89
90 deps = [
91 "..:webrtc_common",
92 "../modules/rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -070093 "../rtc_base:rtc_base_approved",
kjellander0f380d82016-06-01 04:48:26 -070094 "//testing/gtest",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000095 ]
96}
97
ehmaldonado38a21322016-09-02 04:10:34 -070098rtc_source_set("field_trial") {
kjellander0f380d82016-06-01 04:48:26 -070099 testonly = true
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000100 sources = [
101 "field_trial.cc",
102 "field_trial.h",
103 ]
104
105 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000106 "..:webrtc_common",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000107 "../system_wrappers",
phoglund37ebcf02016-01-08 05:04:57 -0800108 "../system_wrappers:field_trial_default",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000109 ]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000110}
111
mbonadeicd95a4e2017-08-23 23:55:54 -0700112if (is_ios) {
113 rtc_source_set("test_support_objc") {
114 testonly = true
115 visibility = [ ":*" ]
116 sources = [
117 "ios/test_support.h",
118 "ios/test_support.mm",
119 ]
120 }
121}
122
mbonadei148d5a22017-04-28 05:24:50 -0700123rtc_source_set("test_support") {
124 testonly = true
kjellander32c4a202016-08-30 02:53:49 -0700125
mbonadei148d5a22017-04-28 05:24:50 -0700126 sources = [
127 "gmock.h",
128 "gtest.h",
129 "testsupport/packet_reader.cc",
130 "testsupport/packet_reader.h",
131 "testsupport/perf_test.cc",
132 "testsupport/perf_test.h",
133 "testsupport/trace_to_stderr.cc",
134 "testsupport/trace_to_stderr.h",
135 "testsupport/unittest_utils.h",
136 ]
137
mbonadeicd95a4e2017-08-23 23:55:54 -0700138 public_deps = [
139 ":fileutils",
140 ]
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200141 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700142 public_deps += [ ":test_support_objc" ]
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200143 }
144
mbonadei148d5a22017-04-28 05:24:50 -0700145 deps = [
146 "..:webrtc_common",
mbonadei148d5a22017-04-28 05:24:50 -0700147 "../common_video",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700148 "../rtc_base:gtest_prod",
149 "../rtc_base:rtc_base_approved",
mbonadei148d5a22017-04-28 05:24:50 -0700150 "../system_wrappers",
151 "//testing/gmock",
152 "//testing/gtest",
153 ]
154
mbonadei148d5a22017-04-28 05:24:50 -0700155 if (!build_with_chromium && is_clang) {
156 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
157 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
158 }
159
160 if (is_android) {
161 deps += [ "//base:base" ]
162 }
163
164 if (is_ios && !build_with_chromium) {
kthelgason36d658d2017-08-24 05:43:45 -0700165 deps += [ "../sdk:common_objc" ]
mbonadei148d5a22017-04-28 05:24:50 -0700166 }
167
168 if (rtc_use_memcheck) {
169 data = valgrind_webrtc_dependencies
kjellander32c4a202016-08-30 02:53:49 -0700170 }
171}
172
mbonadei9452c622017-04-27 12:29:29 -0700173if (!build_with_chromium) {
174 # This target depends on //third_party/gflags and since chromium does not
175 # have gflags it causes an error when Gn parses this BUILD.gn file.
176 # It seems that Gn eagerly tries to understand if all the targets are
177 # buildable (even deps). Obviously gflags is not buildable in chromium
178 # so if a target depends on this BUILD.gn file we hit this error.
179 rtc_source_set("test_main") {
180 testonly = true
181 sources = [
182 "test_main.cc",
183 ]
kjellander0f380d82016-06-01 04:48:26 -0700184
mbonadei9452c622017-04-27 12:29:29 -0700185 public_deps = [
186 ":test_support",
187 ]
188 deps = [
189 ":field_trial",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700190 "../rtc_base:rtc_base_approved",
mbonadei9452c622017-04-27 12:29:29 -0700191 "../system_wrappers:metrics_default",
192 "//testing/gmock",
193 "//testing/gtest",
194 "//third_party/gflags",
195 ]
kjellander0f380d82016-06-01 04:48:26 -0700196 }
197
mbonadei9452c622017-04-27 12:29:29 -0700198 rtc_source_set("video_test_support") {
199 testonly = true
200
201 sources = [
202 "testsupport/frame_reader.h",
203 "testsupport/frame_writer.h",
204 "testsupport/metrics/video_metrics.cc",
205 "testsupport/metrics/video_metrics.h",
206 "testsupport/mock/mock_frame_reader.h",
207 "testsupport/mock/mock_frame_writer.h",
208 "testsupport/y4m_frame_writer.cc",
209 "testsupport/yuv_frame_reader.cc",
210 "testsupport/yuv_frame_writer.cc",
211 ]
212
213 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700214 ":test_support",
215 ":video_test_common",
216 "..:webrtc_common",
ilnikee42d192017-08-22 07:16:20 -0700217 "../api:video_frame_api",
mbonadei9452c622017-04-27 12:29:29 -0700218 "../common_video",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700219 "../rtc_base:rtc_base_approved",
mbonadei9452c622017-04-27 12:29:29 -0700220 "../system_wrappers",
221 "//testing/gmock",
222 "//testing/gtest",
223 "//third_party/gflags",
224 ]
225
ilnikee42d192017-08-22 07:16:20 -0700226 if (!is_ios) {
227 deps += [ "//third_party:jpeg" ]
228 sources += [ "testsupport/jpeg_frame_writer.cc" ]
ilnikd986d762017-08-28 06:08:33 -0700229 } else {
230 sources += [ "testsupport/jpeg_frame_writer_ios.cc" ]
ilnikee42d192017-08-22 07:16:20 -0700231 }
232
mbonadei9452c622017-04-27 12:29:29 -0700233 public_deps = [
234 ":fileutils",
235 ]
236
237 if (!build_with_chromium && is_clang) {
238 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
239 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
240 }
241
242 if (is_android) {
243 deps += [ "//base:base" ]
244 }
245
246 if (is_ios) {
kthelgason36d658d2017-08-24 05:43:45 -0700247 deps += [ "../sdk:common_objc" ]
mbonadei9452c622017-04-27 12:29:29 -0700248 }
249
250 if (rtc_use_memcheck) {
251 data = valgrind_webrtc_dependencies
252 }
kjellander0f380d82016-06-01 04:48:26 -0700253 }
254
ilnike264a9e2017-07-25 07:31:18 -0700255 rtc_source_set("test_support_test_output") {
mbonadei9452c622017-04-27 12:29:29 -0700256 testonly = true
mbonadei9452c622017-04-27 12:29:29 -0700257 sources = [
ilnike264a9e2017-07-25 07:31:18 -0700258 "testsupport/test_output.cc",
259 "testsupport/test_output.h",
mbonadei9452c622017-04-27 12:29:29 -0700260 ]
mbonadei9452c622017-04-27 12:29:29 -0700261 deps = [
mbonadei148d5a22017-04-28 05:24:50 -0700262 ":fileutils",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700263 "../rtc_base:rtc_base_approved",
mbonadei9452c622017-04-27 12:29:29 -0700264 "//third_party/gflags",
265 ]
mbonadei148d5a22017-04-28 05:24:50 -0700266 }
mbonadei9452c622017-04-27 12:29:29 -0700267
mbonadei148d5a22017-04-28 05:24:50 -0700268 test_support_unittests_resources = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700269 "../../resources/foreman_cif_short.yuv",
270 "../../resources/video_coding/frame-ethernet-ii.pcap",
271 "../../resources/video_coding/frame-loopback.pcap",
272 "../../resources/video_coding/pltype103.rtp",
273 "../../resources/video_coding/pltype103_header_only.rtp",
274 "../../resources/video_coding/ssrcs-2.pcap",
275 "../../resources/video_coding/ssrcs-3.pcap",
mbonadei148d5a22017-04-28 05:24:50 -0700276 ]
mbonadei9452c622017-04-27 12:29:29 -0700277
mbonadei148d5a22017-04-28 05:24:50 -0700278 if (is_ios) {
279 bundle_data("test_support_unittests_bundle_data") {
280 testonly = true
281 sources = test_support_unittests_resources
282 outputs = [
283 "{{bundle_resources_dir}}/{{source_file_part}}",
284 ]
mbonadei9452c622017-04-27 12:29:29 -0700285 }
kjellander28a0ffd2016-08-24 07:48:42 -0700286 }
kjellander0f380d82016-06-01 04:48:26 -0700287
mbonadei9452c622017-04-27 12:29:29 -0700288 rtc_test("test_support_unittests") {
mbonadei3edccb92017-06-01 04:47:20 -0700289 deps = [
290 ":fake_audio_device",
291 ":rtp_test_utils",
292 "../api:video_frame_api",
mbonadei3edccb92017-06-01 04:47:20 -0700293 "../call:call_interfaces",
294 "../common_audio",
295 "../modules/rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700296 "../rtc_base:rtc_base_approved",
mbonadei3edccb92017-06-01 04:47:20 -0700297 "../system_wrappers",
298 ]
mbonadei9452c622017-04-27 12:29:29 -0700299 sources = [
300 "fake_audio_device_unittest.cc",
301 "fake_network_pipe_unittest.cc",
302 "frame_generator_unittest.cc",
303 "rtp_file_reader_unittest.cc",
304 "rtp_file_writer_unittest.cc",
eladalon413ee9a2017-08-22 04:02:52 -0700305 "single_threaded_task_queue_unittest.cc",
mbonadei9452c622017-04-27 12:29:29 -0700306 "testsupport/always_passing_unittest.cc",
mbonadei9452c622017-04-27 12:29:29 -0700307 "testsupport/metrics/video_metrics_unittest.cc",
308 "testsupport/packet_reader_unittest.cc",
309 "testsupport/perf_test_unittest.cc",
ilnike264a9e2017-07-25 07:31:18 -0700310 "testsupport/test_output_unittest.cc",
mbonadei9452c622017-04-27 12:29:29 -0700311 "testsupport/y4m_frame_writer_unittest.cc",
312 "testsupport/yuv_frame_reader_unittest.cc",
313 "testsupport/yuv_frame_writer_unittest.cc",
314 ]
kjellander28a0ffd2016-08-24 07:48:42 -0700315
mbonadei9452c622017-04-27 12:29:29 -0700316 # TODO(jschuh): Bug 1348: fix this warning.
317 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
318
319 if (is_win) {
320 # virtual override w/different const/volatile signature.
321 cflags = [ "/wd4373" ]
322 }
323
324 if (!build_with_chromium && is_clang) {
325 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
326 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
327 }
328
329 data = test_support_unittests_resources
330 if (is_android) {
331 deps += [ "//testing/android/native_test:native_test_support" ]
332 shard_timeout = 900
333 }
334
335 if (is_ios) {
336 deps += [ ":test_support_unittests_bundle_data" ]
337 }
338
339 deps += [
340 ":direct_transport",
341 ":fileutils_unittests",
342 ":test_common",
343 ":test_main",
ilnike264a9e2017-07-25 07:31:18 -0700344 ":test_support_test_output",
mbonadei9452c622017-04-27 12:29:29 -0700345 ":video_test_common",
346 ":video_test_support",
347 "../modules/video_capture",
348 "//testing/gmock",
349 "//testing/gtest",
350 "//third_party/gflags",
351 ]
352 }
kjellander0f380d82016-06-01 04:48:26 -0700353}
mbonadei9452c622017-04-27 12:29:29 -0700354
mbonadeicd95a4e2017-08-23 23:55:54 -0700355if (is_ios) {
356 rtc_source_set("fileutils_objc") {
357 visibility = [ ":*" ]
358 sources = [
359 "testsupport/iosfileutils.mm",
360 ]
361 deps = [
362 "..:webrtc_common",
363 "../rtc_base:rtc_base_approved",
kthelgason36d658d2017-08-24 05:43:45 -0700364 "../sdk:common_objc",
mbonadeicd95a4e2017-08-23 23:55:54 -0700365 ]
366 }
367}
368
mbonadei9452c622017-04-27 12:29:29 -0700369rtc_source_set("fileutils") {
370 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700371 visibility = [ ":*" ]
mbonadei9452c622017-04-27 12:29:29 -0700372 sources = [
373 "testsupport/fileutils.cc",
374 "testsupport/fileutils.h",
375 ]
mbonadei3edccb92017-06-01 04:47:20 -0700376 deps = [
377 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700378 "../rtc_base:rtc_base_approved",
mbonadei3edccb92017-06-01 04:47:20 -0700379 ]
mbonadei9452c622017-04-27 12:29:29 -0700380 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700381 deps += [ ":fileutils_objc" ]
mbonadei3edccb92017-06-01 04:47:20 -0700382 }
383 if (is_win) {
ehmaldonadof6a861a2017-07-19 10:40:47 -0700384 deps += [ "../rtc_base:rtc_base" ]
mbonadei9452c622017-04-27 12:29:29 -0700385 }
mbonadei9452c622017-04-27 12:29:29 -0700386}
387
388rtc_source_set("run_test") {
389 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700390 if (is_mac) {
391 public_deps = [
392 ":run_test_objc",
393 ]
394 } else {
395 public_deps = [
396 ":run_test_generic",
397 ]
398 }
399}
400
401rtc_source_set("run_test_interface") {
402 testonly = true
403 visibility = [ ":*" ]
mbonadei9452c622017-04-27 12:29:29 -0700404 sources = [
405 "run_test.h",
406 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700407}
408
409if (is_mac) {
410 rtc_source_set("run_test_objc") {
411 testonly = true
412 visibility = [ ":*" ]
413 sources = [
414 "mac/run_test.mm",
415 ]
416 public_deps = [
417 ":run_test_interface",
418 ]
mbonadei9452c622017-04-27 12:29:29 -0700419 }
420}
421
mbonadeicd95a4e2017-08-23 23:55:54 -0700422rtc_source_set("run_test_generic") {
423 testonly = true
424 visibility = [ ":*" ]
425 sources = [
426 "run_test.cc",
427 ]
428 public_deps = [
429 ":run_test_interface",
430 ]
431}
432
ehmaldonado37535bf2016-12-05 06:42:45 -0800433rtc_source_set("fileutils_unittests") {
434 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700435 visibility = [ ":*" ] # Only targets in this file can depend on this.
ehmaldonado37535bf2016-12-05 06:42:45 -0800436 sources = [
437 "testsupport/fileutils_unittest.cc",
438 ]
439 deps = [
440 ":fileutils",
mbonadei3edccb92017-06-01 04:47:20 -0700441 ":test_support",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700442 "../rtc_base:rtc_base_approved",
ehmaldonado37535bf2016-12-05 06:42:45 -0800443 "//testing/gmock",
444 "//testing/gtest",
445 ]
446}
kjellander0f380d82016-06-01 04:48:26 -0700447
perkj488c5dc2017-02-08 05:55:51 -0800448rtc_source_set("direct_transport") {
449 testonly = true
450 sources = [
451 "direct_transport.cc",
452 "direct_transport.h",
453 "fake_network_pipe.cc",
454 "fake_network_pipe.h",
455 ]
456 if (!build_with_chromium && is_clang) {
457 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
458 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
459 }
460 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700461 "..:webrtc_common",
perkj488c5dc2017-02-08 05:55:51 -0800462 "../api:transport_api",
perkj488c5dc2017-02-08 05:55:51 -0800463 "../call",
mbonadei3edccb92017-06-01 04:47:20 -0700464 "../modules/rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700465 "../rtc_base:rtc_base_approved",
eladalon413ee9a2017-08-22 04:02:52 -0700466 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700467 "../system_wrappers",
perkj488c5dc2017-02-08 05:55:51 -0800468 ]
eladalon413ee9a2017-08-22 04:02:52 -0700469 public_deps = [
470 ":single_threaded_task_queue",
471 ]
472}
473
474rtc_source_set("single_threaded_task_queue") {
475 testonly = true
476 sources = [
477 "single_threaded_task_queue.cc",
478 "single_threaded_task_queue.h",
479 ]
480 deps = [
481 "../rtc_base:rtc_base_approved",
482 ]
perkj488c5dc2017-02-08 05:55:51 -0800483}
484
perkj16ccfdf2017-02-28 14:41:05 -0800485rtc_source_set("fake_audio_device") {
486 testonly = true
487 sources = [
488 "fake_audio_device.cc",
489 "fake_audio_device.h",
490 ]
491 if (!build_with_chromium && is_clang) {
492 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
493 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
494 }
495 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700496 "..:webrtc_common",
mbonadei3edccb92017-06-01 04:47:20 -0700497 "../common_audio:common_audio",
mbonadeib80ef8c2017-04-24 13:05:47 -0700498 "../modules/audio_device:audio_device",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700499 "../rtc_base:rtc_base_approved",
mbonadei3edccb92017-06-01 04:47:20 -0700500 "../system_wrappers:system_wrappers",
perkj16ccfdf2017-02-28 14:41:05 -0800501 ]
502}
503
ehmaldonado38a21322016-09-02 04:10:34 -0700504rtc_source_set("test_common") {
kjellander0f380d82016-06-01 04:48:26 -0700505 testonly = true
506 sources = [
507 "call_test.cc",
508 "call_test.h",
509 "configurable_frame_size_encoder.cc",
510 "configurable_frame_size_encoder.h",
511 "constants.cc",
512 "constants.h",
kjellander0f380d82016-06-01 04:48:26 -0700513 "drifting_clock.cc",
514 "drifting_clock.h",
515 "encoder_settings.cc",
516 "encoder_settings.h",
kjellander0f380d82016-06-01 04:48:26 -0700517 "fake_decoder.cc",
518 "fake_decoder.h",
519 "fake_encoder.cc",
520 "fake_encoder.h",
sakal55d932b2016-09-30 06:19:08 -0700521 "fake_videorenderer.h",
kjellander0f380d82016-06-01 04:48:26 -0700522 "layer_filtering_transport.cc",
523 "layer_filtering_transport.h",
524 "mock_transport.h",
525 "mock_voe_channel_proxy.h",
526 "mock_voice_engine.h",
527 "null_transport.cc",
528 "null_transport.h",
529 "rtp_rtcp_observer.h",
530 "statistics.cc",
531 "statistics.h",
kjellander0f380d82016-06-01 04:48:26 -0700532 "win/run_loop_win.cc",
533 ]
534 if (!is_win) {
535 sources += [
536 "run_loop.cc",
537 "run_loop.h",
538 ]
539 }
540
kjellandere40a7ee2016-10-16 23:56:12 -0700541 if (!build_with_chromium && is_clang) {
542 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700543 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700544 }
545
546 deps = [
perkj488c5dc2017-02-08 05:55:51 -0800547 ":direct_transport",
perkj16ccfdf2017-02-28 14:41:05 -0800548 ":fake_audio_device",
kjellander0f380d82016-06-01 04:48:26 -0700549 ":rtp_test_utils",
550 ":test_support",
perkjc5726c12017-03-01 03:37:08 -0800551 ":video_test_common",
kjellander0f380d82016-06-01 04:48:26 -0700552 "..:webrtc_common",
mbonadei3edccb92017-06-01 04:47:20 -0700553 "../api:transport_api",
554 "../api:video_frame_api",
555 "../api/audio_codecs:builtin_audio_decoder_factory",
ossueb1fde42017-05-02 06:46:30 -0700556 "../api/audio_codecs:builtin_audio_encoder_factory",
ilnikd60d06a2017-04-05 03:02:20 -0700557 "../api/video_codecs:video_codecs_api",
kjellander94cee312016-06-10 01:56:57 -0700558 "../audio",
kjellander94cee312016-06-10 01:56:57 -0700559 "../call",
sprangdb2a9fc2017-08-09 06:42:32 -0700560 "../call:rtp_sender",
aleloi440b6d92017-08-22 05:43:23 -0700561 "../call:video_stream_api",
mbonadei3edccb92017-06-01 04:47:20 -0700562 "../common_video",
563 "../logging:rtc_event_log_api",
564 "../modules/audio_device:mock_audio_device",
aleloi10111bc2016-11-17 06:48:48 -0800565 "../modules/audio_mixer:audio_mixer_impl",
aleloidd310712016-11-17 06:28:59 -0800566 "../modules/audio_processing",
mbonadei3edccb92017-06-01 04:47:20 -0700567 "../modules/rtp_rtcp",
568 "../modules/rtp_rtcp:mock_rtp_rtcp",
569 "../modules/video_coding:webrtc_h264",
570 "../modules/video_coding:webrtc_vp8",
571 "../modules/video_coding:webrtc_vp9",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700572 "../rtc_base:rtc_base_approved",
573 "../rtc_base:rtc_task_queue",
574 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700575 "../system_wrappers",
kjellander94cee312016-06-10 01:56:57 -0700576 "../video",
mbonadei3edccb92017-06-01 04:47:20 -0700577 "../voice_engine",
kjellander0f380d82016-06-01 04:48:26 -0700578 "//testing/gmock",
579 "//testing/gtest",
kjellander0f380d82016-06-01 04:48:26 -0700580 ]
mbonadei148d5a22017-04-28 05:24:50 -0700581 if (!is_android && !build_with_chromium) {
oprypin92220ff2017-03-23 03:40:03 -0700582 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
583 }
kjellander0f380d82016-06-01 04:48:26 -0700584}
585
586config("test_renderer_exported_config") {
587 if (is_win && is_clang) {
588 # GN orders flags on a target before flags from configs. The default config
589 # adds -Wall, and this flag have to be after -Wall -- so they need to
590 # come from a config and cannot be on the target directly.
ehmaldonado4bc4d272016-08-25 04:15:40 -0700591 cflags = [
kjellander0f380d82016-06-01 04:48:26 -0700592 "-Wno-bool-conversion",
593 "-Wno-comment",
594 "-Wno-delete-non-virtual-dtor",
595 ]
596 }
597}
598
ehmaldonado38a21322016-09-02 04:10:34 -0700599rtc_source_set("test_renderer") {
kjellander0f380d82016-06-01 04:48:26 -0700600 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700601 if (is_mac) {
602 public_deps = [
603 ":test_renderer_objc",
604 ]
605 } else {
606 public_deps = [
607 ":test_renderer_generic",
608 ]
609 }
610}
611
612if (is_mac) {
613 rtc_source_set("test_renderer_objc") {
614 testonly = true
615 visibility = [ ":*" ]
616 sources = [
617 "mac/video_renderer_mac.h",
618 "mac/video_renderer_mac.mm",
619 ]
620 public_deps = [
621 ":test_renderer_generic",
622 ]
623 deps = [
624 "../rtc_base:rtc_base_approved",
625 ]
626 libs = [
627 "Cocoa.framework",
628 "OpenGL.framework",
629 "CoreVideo.framework",
630 ]
631 if (!build_with_chromium && is_clang) {
632 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
633 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
634 }
635 }
636}
637
638rtc_source_set("test_renderer_generic") {
639 testonly = true
640 visibility = [ ":*" ]
kjellander0f380d82016-06-01 04:48:26 -0700641 libs = []
642 sources = [
643 "linux/glx_renderer.cc",
644 "linux/glx_renderer.h",
645 "linux/video_renderer_linux.cc",
kjellander0f380d82016-06-01 04:48:26 -0700646 "video_renderer.cc",
647 "video_renderer.h",
648 "win/d3d_renderer.cc",
649 "win/d3d_renderer.h",
650 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700651 deps = [
652 ":test_support",
653 "..:webrtc_common",
654 "../common_video",
655 "../modules/media_file",
656 "../rtc_base:rtc_base_approved",
657 "//testing/gtest",
658 ]
kjellander0f380d82016-06-01 04:48:26 -0700659 if (!is_linux && !is_mac && !is_win) {
660 sources += [ "null_platform_renderer.cc" ]
661 }
662 if (is_linux || is_mac) {
663 sources += [
664 "gl/gl_renderer.cc",
665 "gl/gl_renderer.h",
666 ]
667 }
668
669 if (is_linux) {
670 libs += [
671 "Xext",
672 "X11",
673 "GL",
674 ]
675 }
676 if (is_android) {
677 libs += [
678 "GLESv2",
679 "log",
680 ]
681 }
kjellander0f380d82016-06-01 04:48:26 -0700682
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700683 public_configs = [ ":test_renderer_exported_config" ]
kjellander0f380d82016-06-01 04:48:26 -0700684
kjellandere40a7ee2016-10-16 23:56:12 -0700685 if (!build_with_chromium && is_clang) {
686 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700687 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700688 }
kjellander0f380d82016-06-01 04:48:26 -0700689}
kwiberg37e99fd2017-04-10 05:15:48 -0700690
691rtc_source_set("audio_codec_mocks") {
692 testonly = true
693 sources = [
kwiberg2b3aa142017-06-14 03:31:17 -0700694 "mock_audio_decoder.cc",
kwiberg37e99fd2017-04-10 05:15:48 -0700695 "mock_audio_decoder.h",
696 "mock_audio_decoder_factory.h",
ossueb1fde42017-05-02 06:46:30 -0700697 "mock_audio_encoder.cc",
698 "mock_audio_encoder.h",
699 "mock_audio_encoder_factory.h",
700 ]
701
702 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700703 ":test_support",
ossueb1fde42017-05-02 06:46:30 -0700704 "../api/audio_codecs:audio_codecs_api",
mbonadei3edccb92017-06-01 04:47:20 -0700705 "../api/audio_codecs:builtin_audio_decoder_factory",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700706 "../rtc_base:rtc_base_approved",
ossueb1fde42017-05-02 06:46:30 -0700707 "//testing/gmock",
kwiberg37e99fd2017-04-10 05:15:48 -0700708 ]
709}
sakald7fdb802017-05-26 01:51:53 -0700710
711if (!build_with_chromium && is_android) {
712 android_library("native_test_java") {
713 testonly = true
714 java_files = [
715 "android/org/webrtc/native_test/RTCNativeUnitTest.java",
716 "android/org/webrtc/native_test/RTCNativeUnitTestActivity.java",
717 ]
718 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700719 "../rtc_base:base_java",
sakald7fdb802017-05-26 01:51:53 -0700720 "//testing/android/native_test:native_test_java",
sakald7fdb802017-05-26 01:51:53 -0700721 ]
charujain474acce2017-08-25 06:21:52 -0700722
723 # TODO(sakal): Fix build hooks crbug.com/webrtc/8148
724 no_build_hooks = true
sakald7fdb802017-05-26 01:51:53 -0700725 }
726}