blob: a74683315c91443e8f3d2f0d4600c59754613fae [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
oprypinfbbba3f2017-09-25 08:34:41 -070030 if (rtc_include_tests) {
mbonadei148d5a22017-04-28 05:24:50 -070031 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",
kwiberg84f6a3f2017-09-05 08:43:13 -070063 "../api:optional",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +010064 "../api:video_frame_api_i420",
mflodman351424e2017-08-10 02:43:14 -070065 "../api/video_codecs:video_codecs_api",
aleloi440b6d92017-08-22 05:43:23 -070066 "../call:video_stream_api",
kjellander0f380d82016-06-01 04:48:26 -070067 "../common_video",
sprangc5d62e22017-04-02 23:53:04 -070068 "../media:rtc_media_base",
ehmaldonado656610f2017-02-06 02:21:11 -080069 "../modules/video_capture:video_capture_module",
ehmaldonadof6a861a2017-07-19 10:40:47 -070070 "../rtc_base:rtc_base_approved",
71 "../rtc_base:rtc_task_queue",
mbonadei3edccb92017-06-01 04:47:20 -070072 "../system_wrappers",
kjellander0f380d82016-06-01 04:48:26 -070073 ]
74}
75
ehmaldonado38a21322016-09-02 04:10:34 -070076rtc_source_set("rtp_test_utils") {
kjellander0f380d82016-06-01 04:48:26 -070077 testonly = true
78 sources = [
79 "rtcp_packet_parser.cc",
80 "rtcp_packet_parser.h",
81 "rtp_file_reader.cc",
82 "rtp_file_reader.h",
83 "rtp_file_writer.cc",
84 "rtp_file_writer.h",
85 ]
86
kjellandere40a7ee2016-10-16 23:56:12 -070087 if (!build_with_chromium && is_clang) {
88 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070089 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -070090 }
91
92 deps = [
93 "..:webrtc_common",
kwiberg529662a2017-09-04 05:43:17 -070094 "../api:array_view",
kjellander0f380d82016-06-01 04:48:26 -070095 "../modules/rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +010096 "../modules/rtp_rtcp:rtp_rtcp_format",
ehmaldonadof6a861a2017-07-19 10:40:47 -070097 "../rtc_base:rtc_base_approved",
kjellander0f380d82016-06-01 04:48:26 -070098 "//testing/gtest",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000099 ]
100}
101
ehmaldonado38a21322016-09-02 04:10:34 -0700102rtc_source_set("field_trial") {
kjellander0f380d82016-06-01 04:48:26 -0700103 testonly = true
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000104 sources = [
105 "field_trial.cc",
106 "field_trial.h",
107 ]
108
109 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000110 "..:webrtc_common",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100111 "../system_wrappers:field_trial_api",
phoglund37ebcf02016-01-08 05:04:57 -0800112 "../system_wrappers:field_trial_default",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000113 ]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000114}
115
Edward Lemur10a8e7a2017-12-13 13:23:17 +0100116rtc_source_set("perf_test") {
117 testonly = true
118 sources = [
119 "testsupport/perf_test.cc",
120 "testsupport/perf_test.h",
121 ]
122 deps = [
123 "..:webrtc_common",
124 "../api:array_view",
125 "../rtc_base:rtc_base_approved",
126 ]
127}
128
mbonadeicd95a4e2017-08-23 23:55:54 -0700129if (is_ios) {
130 rtc_source_set("test_support_objc") {
131 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700132 visibility = [ ":test_support" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700133 sources = [
134 "ios/test_support.h",
135 "ios/test_support.mm",
136 ]
denicijad207a392017-09-11 06:43:28 -0700137 deps = [
Edward Lemur10a8e7a2017-12-13 13:23:17 +0100138 ":perf_test",
denicijad207a392017-09-11 06:43:28 -0700139 "../sdk:common_objc",
140 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700141 }
142}
143
mbonadei148d5a22017-04-28 05:24:50 -0700144rtc_source_set("test_support") {
145 testonly = true
kjellander32c4a202016-08-30 02:53:49 -0700146
mbonadei148d5a22017-04-28 05:24:50 -0700147 sources = [
148 "gmock.h",
149 "gtest.h",
150 "testsupport/packet_reader.cc",
151 "testsupport/packet_reader.h",
mbonadei148d5a22017-04-28 05:24:50 -0700152 "testsupport/unittest_utils.h",
153 ]
154
mbonadeicd95a4e2017-08-23 23:55:54 -0700155 public_deps = [
156 ":fileutils",
157 ]
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200158 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700159 public_deps += [ ":test_support_objc" ]
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200160 }
161
mbonadei148d5a22017-04-28 05:24:50 -0700162 deps = [
163 "..:webrtc_common",
Edward Lemur936dfb12017-11-30 11:43:42 +0100164 "../api:array_view",
mbonadei148d5a22017-04-28 05:24:50 -0700165 "../common_video",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700166 "../rtc_base:gtest_prod",
167 "../rtc_base:rtc_base_approved",
mbonadei148d5a22017-04-28 05:24:50 -0700168 "../system_wrappers",
169 "//testing/gmock",
170 "//testing/gtest",
171 ]
172
mbonadei148d5a22017-04-28 05:24:50 -0700173 if (!build_with_chromium && is_clang) {
174 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
175 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
176 }
177
178 if (is_android) {
179 deps += [ "//base:base" ]
180 }
181
182 if (is_ios && !build_with_chromium) {
kthelgason36d658d2017-08-24 05:43:45 -0700183 deps += [ "../sdk:common_objc" ]
mbonadei148d5a22017-04-28 05:24:50 -0700184 }
185
186 if (rtc_use_memcheck) {
187 data = valgrind_webrtc_dependencies
kjellander32c4a202016-08-30 02:53:49 -0700188 }
189}
190
oprypinfbbba3f2017-09-25 08:34:41 -0700191if (rtc_include_tests) {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000192 rtc_source_set("test_main") {
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200193 testonly = true
Oleh Prypin5ab68542017-09-25 09:18:00 +0000194 sources = [
195 "test_main.cc",
196 ]
197
198 public_deps = [
199 ":test_support",
200 ]
201 deps = [
202 ":field_trial",
Edward Lemur10a8e7a2017-12-13 13:23:17 +0100203 ":perf_test",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000204 "../rtc_base:rtc_base_approved",
205 "../system_wrappers:metrics_default",
206 "//testing/gmock",
207 "//testing/gtest",
mbonadei9452c622017-04-27 12:29:29 -0700208 ]
209 }
mbonadei9452c622017-04-27 12:29:29 -0700210
Oleh Prypin5ab68542017-09-25 09:18:00 +0000211 rtc_source_set("video_test_support") {
212 testonly = true
213
214 sources = [
215 "testsupport/frame_reader.h",
216 "testsupport/frame_writer.h",
217 "testsupport/metrics/video_metrics.cc",
218 "testsupport/metrics/video_metrics.h",
219 "testsupport/mock/mock_frame_reader.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000220 "testsupport/y4m_frame_writer.cc",
221 "testsupport/yuv_frame_reader.cc",
222 "testsupport/yuv_frame_writer.cc",
223 ]
224
225 deps = [
226 ":test_support",
227 ":video_test_common",
Mirko Bonadei0250be52017-12-01 13:53:04 +0100228 "$rtc_libyuv_dir",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000229 "..:webrtc_common",
230 "../api:video_frame_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100231 "../api:video_frame_api_i420",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000232 "../common_video",
233 "../rtc_base:rtc_base_approved",
234 "../system_wrappers",
235 "//testing/gmock",
236 "//testing/gtest",
237 ]
238
239 if (!is_ios) {
240 deps += [ "//third_party:jpeg" ]
241 sources += [ "testsupport/jpeg_frame_writer.cc" ]
242 } else {
243 sources += [ "testsupport/jpeg_frame_writer_ios.cc" ]
244 }
245
246 public_deps = [
247 ":fileutils",
248 ]
249
250 if (!build_with_chromium && is_clang) {
251 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
252 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
253 }
254
255 if (is_android) {
256 deps += [ "//base:base" ]
257 }
258
259 if (is_ios) {
260 deps += [ "../sdk:common_objc" ]
261 }
262
263 if (rtc_use_memcheck) {
264 data = valgrind_webrtc_dependencies
265 }
266 }
267
Edward Lemuraf8659a2017-09-27 14:46:24 +0200268 rtc_source_set("test_support_test_artifacts") {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000269 testonly = true
270 sources = [
Edward Lemuraf8659a2017-09-27 14:46:24 +0200271 "testsupport/test_artifacts.cc",
272 "testsupport/test_artifacts.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000273 ]
274 deps = [
275 ":fileutils",
276 "../rtc_base:rtc_base_approved",
277 ]
278 }
279
280 test_support_unittests_resources = [
281 "../resources/foreman_cif_short.yuv",
282 "../resources/video_coding/frame-ethernet-ii.pcap",
283 "../resources/video_coding/frame-loopback.pcap",
284 "../resources/video_coding/pltype103.rtp",
285 "../resources/video_coding/pltype103_header_only.rtp",
286 "../resources/video_coding/ssrcs-2.pcap",
287 "../resources/video_coding/ssrcs-3.pcap",
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200288 ]
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200289
290 if (is_ios) {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000291 bundle_data("test_support_unittests_bundle_data") {
292 testonly = true
293 sources = test_support_unittests_resources
294 outputs = [
295 "{{bundle_resources_dir}}/{{source_file_part}}",
296 ]
297 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200298 }
299
Oleh Prypin5ab68542017-09-25 09:18:00 +0000300 rtc_test("test_support_unittests") {
301 deps = [
302 ":fake_audio_device",
Edward Lemur10a8e7a2017-12-13 13:23:17 +0100303 ":perf_test",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000304 ":rtp_test_utils",
305 "../api:video_frame_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100306 "../api:video_frame_api_i420",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000307 "../call:call_interfaces",
308 "../common_audio",
309 "../modules/rtp_rtcp",
310 "../rtc_base:rtc_base_approved",
311 "../system_wrappers",
312 ]
313 sources = [
314 "fake_audio_device_unittest.cc",
315 "fake_network_pipe_unittest.cc",
316 "frame_generator_unittest.cc",
317 "rtp_file_reader_unittest.cc",
318 "rtp_file_writer_unittest.cc",
319 "single_threaded_task_queue_unittest.cc",
320 "testsupport/always_passing_unittest.cc",
321 "testsupport/metrics/video_metrics_unittest.cc",
322 "testsupport/packet_reader_unittest.cc",
323 "testsupport/perf_test_unittest.cc",
Edward Lemuraf8659a2017-09-27 14:46:24 +0200324 "testsupport/test_artifacts_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000325 "testsupport/y4m_frame_writer_unittest.cc",
326 "testsupport/yuv_frame_reader_unittest.cc",
327 "testsupport/yuv_frame_writer_unittest.cc",
328 ]
329
330 # TODO(jschuh): Bug 1348: fix this warning.
331 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
332
333 if (is_win) {
334 # virtual override w/different const/volatile signature.
335 cflags = [ "/wd4373" ]
336 }
337
338 if (!build_with_chromium && is_clang) {
339 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
340 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
341 }
342
343 data = test_support_unittests_resources
344 if (is_android) {
345 deps += [ "//testing/android/native_test:native_test_support" ]
346 shard_timeout = 900
347 }
348
349 if (is_ios) {
350 deps += [ ":test_support_unittests_bundle_data" ]
351 }
352
353 deps += [
354 ":direct_transport",
355 ":fileutils_unittests",
356 ":test_common",
357 ":test_main",
Edward Lemuraf8659a2017-09-27 14:46:24 +0200358 ":test_support_test_artifacts",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000359 ":video_test_common",
360 ":video_test_support",
361 "../modules/video_capture",
362 "../rtc_base:rtc_base_approved",
363 "//testing/gmock",
364 "//testing/gtest",
365 ]
366 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200367}
368
mbonadeicd95a4e2017-08-23 23:55:54 -0700369if (is_ios) {
370 rtc_source_set("fileutils_objc") {
mbonadei9c296b32017-09-05 05:11:41 -0700371 visibility = [ ":fileutils" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700372 sources = [
373 "testsupport/iosfileutils.mm",
374 ]
375 deps = [
376 "..:webrtc_common",
377 "../rtc_base:rtc_base_approved",
kthelgason36d658d2017-08-24 05:43:45 -0700378 "../sdk:common_objc",
mbonadeicd95a4e2017-08-23 23:55:54 -0700379 ]
380 }
381}
382
mbonadei9452c622017-04-27 12:29:29 -0700383rtc_source_set("fileutils") {
384 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700385 visibility = [
386 ":fileutils_unittests",
Edward Lemuraf8659a2017-09-27 14:46:24 +0200387 ":test_support_test_artifacts",
mbonadei9c296b32017-09-05 05:11:41 -0700388 ":test_support",
389 ":video_test_support",
390 ]
mbonadei9452c622017-04-27 12:29:29 -0700391 sources = [
392 "testsupport/fileutils.cc",
393 "testsupport/fileutils.h",
394 ]
mbonadei3edccb92017-06-01 04:47:20 -0700395 deps = [
396 "..:webrtc_common",
kwiberg84f6a3f2017-09-05 08:43:13 -0700397 "../api:optional",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700398 "../rtc_base:rtc_base_approved",
mbonadei3edccb92017-06-01 04:47:20 -0700399 ]
mbonadei9452c622017-04-27 12:29:29 -0700400 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700401 deps += [ ":fileutils_objc" ]
mbonadei3edccb92017-06-01 04:47:20 -0700402 }
403 if (is_win) {
ehmaldonadof6a861a2017-07-19 10:40:47 -0700404 deps += [ "../rtc_base:rtc_base" ]
mbonadei9452c622017-04-27 12:29:29 -0700405 }
mbonadei9452c622017-04-27 12:29:29 -0700406}
407
408rtc_source_set("run_test") {
409 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700410 if (is_mac) {
411 public_deps = [
412 ":run_test_objc",
413 ]
414 } else {
415 public_deps = [
416 ":run_test_generic",
417 ]
418 }
419}
420
421rtc_source_set("run_test_interface") {
mbonadei9452c622017-04-27 12:29:29 -0700422 sources = [
423 "run_test.h",
424 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700425}
426
427if (is_mac) {
428 rtc_source_set("run_test_objc") {
429 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700430 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700431 sources = [
432 "mac/run_test.mm",
433 ]
mbonadei9c296b32017-09-05 05:11:41 -0700434 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700435 ":run_test_interface",
436 ]
mbonadei9452c622017-04-27 12:29:29 -0700437 }
438}
439
mbonadeicd95a4e2017-08-23 23:55:54 -0700440rtc_source_set("run_test_generic") {
441 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700442 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700443 sources = [
444 "run_test.cc",
445 ]
mbonadei9c296b32017-09-05 05:11:41 -0700446 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700447 ":run_test_interface",
448 ]
449}
450
ehmaldonado37535bf2016-12-05 06:42:45 -0800451rtc_source_set("fileutils_unittests") {
452 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700453 visibility = [ ":*" ] # Only targets in this file can depend on this.
ehmaldonado37535bf2016-12-05 06:42:45 -0800454 sources = [
455 "testsupport/fileutils_unittest.cc",
456 ]
457 deps = [
458 ":fileutils",
mbonadei3edccb92017-06-01 04:47:20 -0700459 ":test_support",
kwiberg84f6a3f2017-09-05 08:43:13 -0700460 "../api:optional",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700461 "../rtc_base:rtc_base_approved",
ehmaldonado37535bf2016-12-05 06:42:45 -0800462 "//testing/gmock",
463 "//testing/gtest",
464 ]
465}
kjellander0f380d82016-06-01 04:48:26 -0700466
perkj488c5dc2017-02-08 05:55:51 -0800467rtc_source_set("direct_transport") {
468 testonly = true
469 sources = [
470 "direct_transport.cc",
471 "direct_transport.h",
472 "fake_network_pipe.cc",
473 "fake_network_pipe.h",
474 ]
475 if (!build_with_chromium && is_clang) {
476 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
477 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
478 }
479 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700480 "..:webrtc_common",
perkj488c5dc2017-02-08 05:55:51 -0800481 "../api:transport_api",
perkj488c5dc2017-02-08 05:55:51 -0800482 "../call",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100483 "../call:call_interfaces",
mbonadei3edccb92017-06-01 04:47:20 -0700484 "../modules/rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700485 "../rtc_base:rtc_base_approved",
eladalon413ee9a2017-08-22 04:02:52 -0700486 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700487 "../system_wrappers",
perkj488c5dc2017-02-08 05:55:51 -0800488 ]
eladalon413ee9a2017-08-22 04:02:52 -0700489 public_deps = [
490 ":single_threaded_task_queue",
491 ]
492}
493
494rtc_source_set("single_threaded_task_queue") {
495 testonly = true
496 sources = [
497 "single_threaded_task_queue.cc",
498 "single_threaded_task_queue.h",
499 ]
500 deps = [
501 "../rtc_base:rtc_base_approved",
502 ]
perkj488c5dc2017-02-08 05:55:51 -0800503}
504
perkj16ccfdf2017-02-28 14:41:05 -0800505rtc_source_set("fake_audio_device") {
506 testonly = true
507 sources = [
508 "fake_audio_device.cc",
509 "fake_audio_device.h",
510 ]
511 if (!build_with_chromium && is_clang) {
512 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
513 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
514 }
515 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700516 "..:webrtc_common",
kwiberg529662a2017-09-04 05:43:17 -0700517 "../api:array_view",
mbonadei3edccb92017-06-01 04:47:20 -0700518 "../common_audio:common_audio",
mbonadeib80ef8c2017-04-24 13:05:47 -0700519 "../modules/audio_device:audio_device",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700520 "../rtc_base:rtc_base_approved",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100521 "../system_wrappers",
perkj16ccfdf2017-02-28 14:41:05 -0800522 ]
523}
524
ehmaldonado38a21322016-09-02 04:10:34 -0700525rtc_source_set("test_common") {
kjellander0f380d82016-06-01 04:48:26 -0700526 testonly = true
527 sources = [
528 "call_test.cc",
529 "call_test.h",
530 "configurable_frame_size_encoder.cc",
531 "configurable_frame_size_encoder.h",
532 "constants.cc",
533 "constants.h",
kjellander0f380d82016-06-01 04:48:26 -0700534 "drifting_clock.cc",
535 "drifting_clock.h",
536 "encoder_settings.cc",
537 "encoder_settings.h",
kjellander0f380d82016-06-01 04:48:26 -0700538 "fake_decoder.cc",
539 "fake_decoder.h",
540 "fake_encoder.cc",
541 "fake_encoder.h",
sakal55d932b2016-09-30 06:19:08 -0700542 "fake_videorenderer.h",
kjellander0f380d82016-06-01 04:48:26 -0700543 "layer_filtering_transport.cc",
544 "layer_filtering_transport.h",
545 "mock_transport.h",
546 "mock_voe_channel_proxy.h",
547 "mock_voice_engine.h",
548 "null_transport.cc",
549 "null_transport.h",
550 "rtp_rtcp_observer.h",
551 "statistics.cc",
552 "statistics.h",
kjellander0f380d82016-06-01 04:48:26 -0700553 "win/run_loop_win.cc",
554 ]
555 if (!is_win) {
556 sources += [
557 "run_loop.cc",
558 "run_loop.h",
559 ]
560 }
561
kjellandere40a7ee2016-10-16 23:56:12 -0700562 if (!build_with_chromium && is_clang) {
563 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700564 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700565 }
566
567 deps = [
perkj488c5dc2017-02-08 05:55:51 -0800568 ":direct_transport",
perkj16ccfdf2017-02-28 14:41:05 -0800569 ":fake_audio_device",
kjellander0f380d82016-06-01 04:48:26 -0700570 ":rtp_test_utils",
571 ":test_support",
perkjc5726c12017-03-01 03:37:08 -0800572 ":video_test_common",
kjellander0f380d82016-06-01 04:48:26 -0700573 "..:webrtc_common",
mbonadei3edccb92017-06-01 04:47:20 -0700574 "../api:transport_api",
575 "../api:video_frame_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100576 "../api:video_frame_api_i420",
mbonadei3edccb92017-06-01 04:47:20 -0700577 "../api/audio_codecs:builtin_audio_decoder_factory",
ossueb1fde42017-05-02 06:46:30 -0700578 "../api/audio_codecs:builtin_audio_encoder_factory",
ilnikd60d06a2017-04-05 03:02:20 -0700579 "../api/video_codecs:video_codecs_api",
kjellander94cee312016-06-10 01:56:57 -0700580 "../audio",
kjellander94cee312016-06-10 01:56:57 -0700581 "../call",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100582 "../call:call_interfaces",
sprangdb2a9fc2017-08-09 06:42:32 -0700583 "../call:rtp_sender",
aleloi440b6d92017-08-22 05:43:23 -0700584 "../call:video_stream_api",
mbonadei3edccb92017-06-01 04:47:20 -0700585 "../common_video",
586 "../logging:rtc_event_log_api",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100587 "../media:rtc_media_base",
mbonadei3edccb92017-06-01 04:47:20 -0700588 "../modules/audio_device:mock_audio_device",
aleloi10111bc2016-11-17 06:48:48 -0800589 "../modules/audio_mixer:audio_mixer_impl",
aleloidd310712016-11-17 06:28:59 -0800590 "../modules/audio_processing",
mbonadei3edccb92017-06-01 04:47:20 -0700591 "../modules/rtp_rtcp",
592 "../modules/rtp_rtcp:mock_rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100593 "../modules/rtp_rtcp:rtp_rtcp_format",
charujaincb728ea2017-09-18 03:08:08 -0700594 "../modules/video_coding:video_coding_utility",
mbonadei3edccb92017-06-01 04:47:20 -0700595 "../modules/video_coding:webrtc_h264",
596 "../modules/video_coding:webrtc_vp8",
597 "../modules/video_coding:webrtc_vp9",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700598 "../rtc_base:rtc_base_approved",
599 "../rtc_base:rtc_task_queue",
600 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700601 "../system_wrappers",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100602 "../system_wrappers:field_trial_api",
kjellander94cee312016-06-10 01:56:57 -0700603 "../video",
mbonadei3edccb92017-06-01 04:47:20 -0700604 "../voice_engine",
kjellander0f380d82016-06-01 04:48:26 -0700605 "//testing/gmock",
606 "//testing/gtest",
kjellander0f380d82016-06-01 04:48:26 -0700607 ]
mbonadei148d5a22017-04-28 05:24:50 -0700608 if (!is_android && !build_with_chromium) {
oprypin92220ff2017-03-23 03:40:03 -0700609 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
610 }
kjellander0f380d82016-06-01 04:48:26 -0700611}
612
613config("test_renderer_exported_config") {
614 if (is_win && is_clang) {
615 # GN orders flags on a target before flags from configs. The default config
616 # adds -Wall, and this flag have to be after -Wall -- so they need to
617 # come from a config and cannot be on the target directly.
ehmaldonado4bc4d272016-08-25 04:15:40 -0700618 cflags = [
kjellander0f380d82016-06-01 04:48:26 -0700619 "-Wno-bool-conversion",
620 "-Wno-comment",
621 "-Wno-delete-non-virtual-dtor",
622 ]
623 }
624}
625
ehmaldonado38a21322016-09-02 04:10:34 -0700626rtc_source_set("test_renderer") {
mbonadei9c296b32017-09-05 05:11:41 -0700627 public_deps = [
628 ":test_renderer_generic",
629 ]
kjellander0f380d82016-06-01 04:48:26 -0700630 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700631 if (is_mac) {
mbonadei9c296b32017-09-05 05:11:41 -0700632 public_deps += [ ":test_renderer_objc" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700633 }
634}
635
636if (is_mac) {
637 rtc_source_set("test_renderer_objc") {
638 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700639 visibility = [ ":test_renderer" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700640 sources = [
641 "mac/video_renderer_mac.h",
642 "mac/video_renderer_mac.mm",
643 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700644 deps = [
mbonadei9c296b32017-09-05 05:11:41 -0700645 ":test_renderer_generic",
mbonadeicd95a4e2017-08-23 23:55:54 -0700646 "../rtc_base:rtc_base_approved",
647 ]
648 libs = [
649 "Cocoa.framework",
650 "OpenGL.framework",
651 "CoreVideo.framework",
652 ]
653 if (!build_with_chromium && is_clang) {
654 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
655 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
656 }
657 }
658}
659
660rtc_source_set("test_renderer_generic") {
661 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700662 visibility = [
663 ":test_renderer",
664 ":test_renderer_objc",
665 ]
kjellander0f380d82016-06-01 04:48:26 -0700666 libs = []
667 sources = [
kjellander0f380d82016-06-01 04:48:26 -0700668 "video_renderer.cc",
669 "video_renderer.h",
670 "win/d3d_renderer.cc",
671 "win/d3d_renderer.h",
672 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700673 deps = [
674 ":test_support",
675 "..:webrtc_common",
676 "../common_video",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100677 "../media:rtc_media_base",
mbonadeicd95a4e2017-08-23 23:55:54 -0700678 "../modules/media_file",
679 "../rtc_base:rtc_base_approved",
680 "//testing/gtest",
681 ]
Edward Lemur84a87c42017-11-07 19:07:31 +0100682 if (!(is_linux && use_x11) && !is_mac && !is_win) {
kjellander0f380d82016-06-01 04:48:26 -0700683 sources += [ "null_platform_renderer.cc" ]
684 }
Edward Lemur84a87c42017-11-07 19:07:31 +0100685 if ((is_linux && use_x11) || is_mac) {
kjellander0f380d82016-06-01 04:48:26 -0700686 sources += [
687 "gl/gl_renderer.cc",
688 "gl/gl_renderer.h",
689 ]
690 }
691
Edward Lemur84a87c42017-11-07 19:07:31 +0100692 if (is_linux && use_x11) {
693 sources += [
694 "linux/glx_renderer.cc",
695 "linux/glx_renderer.h",
696 "linux/video_renderer_linux.cc",
697 ]
kjellander0f380d82016-06-01 04:48:26 -0700698 libs += [
699 "Xext",
700 "X11",
701 "GL",
702 ]
703 }
704 if (is_android) {
705 libs += [
706 "GLESv2",
707 "log",
708 ]
709 }
kjellander0f380d82016-06-01 04:48:26 -0700710
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700711 public_configs = [ ":test_renderer_exported_config" ]
kjellander0f380d82016-06-01 04:48:26 -0700712
kjellandere40a7ee2016-10-16 23:56:12 -0700713 if (!build_with_chromium && is_clang) {
714 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700715 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700716 }
kjellander0f380d82016-06-01 04:48:26 -0700717}
kwiberg37e99fd2017-04-10 05:15:48 -0700718
719rtc_source_set("audio_codec_mocks") {
720 testonly = true
721 sources = [
kwiberg2b3aa142017-06-14 03:31:17 -0700722 "mock_audio_decoder.cc",
kwiberg37e99fd2017-04-10 05:15:48 -0700723 "mock_audio_decoder.h",
724 "mock_audio_decoder_factory.h",
ossueb1fde42017-05-02 06:46:30 -0700725 "mock_audio_encoder.cc",
726 "mock_audio_encoder.h",
727 "mock_audio_encoder_factory.h",
728 ]
729
730 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700731 ":test_support",
kwiberg529662a2017-09-04 05:43:17 -0700732 "../api:array_view",
ossueb1fde42017-05-02 06:46:30 -0700733 "../api/audio_codecs:audio_codecs_api",
mbonadei3edccb92017-06-01 04:47:20 -0700734 "../api/audio_codecs:builtin_audio_decoder_factory",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700735 "../rtc_base:rtc_base_approved",
ossueb1fde42017-05-02 06:46:30 -0700736 "//testing/gmock",
kwiberg37e99fd2017-04-10 05:15:48 -0700737 ]
738}
sakald7fdb802017-05-26 01:51:53 -0700739
740if (!build_with_chromium && is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000741 rtc_android_library("native_test_java") {
sakald7fdb802017-05-26 01:51:53 -0700742 testonly = true
743 java_files = [
744 "android/org/webrtc/native_test/RTCNativeUnitTest.java",
745 "android/org/webrtc/native_test/RTCNativeUnitTestActivity.java",
746 ]
747 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700748 "../rtc_base:base_java",
sakald7fdb802017-05-26 01:51:53 -0700749 "//testing/android/native_test:native_test_java",
sakald7fdb802017-05-26 01:51:53 -0700750 ]
751 }
752}