blob: b4b12772215ed440e76720c71fdc028c08e0e045 [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") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000039 visibility = [ "*" ]
kjellander0f380d82016-06-01 04:48:26 -070040 testonly = true
41 sources = [
42 "fake_texture_frame.cc",
43 "fake_texture_frame.h",
44 "frame_generator.cc",
45 "frame_generator.h",
ehmaldonado656610f2017-02-06 02:21:11 -080046 "frame_generator_capturer.cc",
47 "frame_generator_capturer.h",
kjellander0f380d82016-06-01 04:48:26 -070048 "frame_utils.cc",
49 "frame_utils.h",
ehmaldonado656610f2017-02-06 02:21:11 -080050 "vcm_capturer.cc",
51 "vcm_capturer.h",
sprangc5d62e22017-04-02 23:53:04 -070052 "video_capturer.cc",
ehmaldonado656610f2017-02-06 02:21:11 -080053 "video_capturer.h",
mflodman351424e2017-08-10 02:43:14 -070054 "video_codec_settings.h",
kjellander0f380d82016-06-01 04:48:26 -070055 ]
56
kjellandere40a7ee2016-10-16 23:56:12 -070057 if (!build_with_chromium && is_clang) {
58 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070059 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -070060 }
61
62 deps = [
mbonadei3edccb92017-06-01 04:47:20 -070063 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +010064 "../:typedefs",
Patrik Höglund9e194032018-01-04 15:58:20 +010065 "../api:libjingle_peerconnection_api",
kwiberg84f6a3f2017-09-05 08:43:13 -070066 "../api:optional",
Mirko Bonadei0594a7c2017-12-18 11:42:48 +010067 "../api:video_frame_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +010068 "../api:video_frame_api_i420",
mflodman351424e2017-08-10 02:43:14 -070069 "../api/video_codecs:video_codecs_api",
aleloi440b6d92017-08-22 05:43:23 -070070 "../call:video_stream_api",
kjellander0f380d82016-06-01 04:48:26 -070071 "../common_video",
sprangc5d62e22017-04-02 23:53:04 -070072 "../media:rtc_media_base",
ehmaldonado656610f2017-02-06 02:21:11 -080073 "../modules/video_capture:video_capture_module",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010074 "../rtc_base:checks",
Patrik Höglund76df0df2017-12-19 11:50:21 +010075 "../rtc_base:rtc_base",
ehmaldonadof6a861a2017-07-19 10:40:47 -070076 "../rtc_base:rtc_task_queue",
mbonadei3edccb92017-06-01 04:47:20 -070077 "../system_wrappers",
kjellander0f380d82016-06-01 04:48:26 -070078 ]
79}
80
ehmaldonado38a21322016-09-02 04:10:34 -070081rtc_source_set("rtp_test_utils") {
kjellander0f380d82016-06-01 04:48:26 -070082 testonly = true
83 sources = [
84 "rtcp_packet_parser.cc",
85 "rtcp_packet_parser.h",
86 "rtp_file_reader.cc",
87 "rtp_file_reader.h",
88 "rtp_file_writer.cc",
89 "rtp_file_writer.h",
90 ]
91
kjellandere40a7ee2016-10-16 23:56:12 -070092 if (!build_with_chromium && is_clang) {
93 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070094 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -070095 }
96
97 deps = [
98 "..:webrtc_common",
kwiberg529662a2017-09-04 05:43:17 -070099 "../api:array_view",
kjellander0f380d82016-06-01 04:48:26 -0700100 "../modules/rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100101 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100102 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700103 "../rtc_base:rtc_base_approved",
kjellander0f380d82016-06-01 04:48:26 -0700104 "//testing/gtest",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000105 ]
106}
107
ehmaldonado38a21322016-09-02 04:10:34 -0700108rtc_source_set("field_trial") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000109 visibility = [ "*" ]
kjellander0f380d82016-06-01 04:48:26 -0700110 testonly = true
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000111 sources = [
112 "field_trial.cc",
113 "field_trial.h",
114 ]
115
116 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000117 "..:webrtc_common",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100118 "../system_wrappers:field_trial_api",
phoglund37ebcf02016-01-08 05:04:57 -0800119 "../system_wrappers:field_trial_default",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000120 ]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000121}
122
Edward Lemure66572b2018-01-05 15:34:09 +0100123rtc_source_set("perf_test") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000124 visibility = [ "*" ]
Edward Lemure66572b2018-01-05 15:34:09 +0100125 sources = [
126 "testsupport/perf_test.cc",
127 "testsupport/perf_test.h",
128 ]
129 deps = [
130 "..:webrtc_common",
131 "../api:array_view",
132 "../rtc_base:rtc_base_approved",
133 ]
134}
135
mbonadeicd95a4e2017-08-23 23:55:54 -0700136if (is_ios) {
137 rtc_source_set("test_support_objc") {
138 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700139 visibility = [ ":test_support" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700140 sources = [
141 "ios/test_support.h",
142 "ios/test_support.mm",
143 ]
denicijad207a392017-09-11 06:43:28 -0700144 deps = [
Edward Lemure66572b2018-01-05 15:34:09 +0100145 ":perf_test",
denicijad207a392017-09-11 06:43:28 -0700146 "../sdk:common_objc",
147 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700148 }
149}
150
Patrik Höglund34924c22018-01-19 09:11:07 +0100151config("suppress_warning_4373") {
152 if (is_win) {
153 cflags = [
154 # MSVC has a bug which generates this warning when using mocks; see the
155 # section on warning 4373 in he googlemock FAQ. This warning isn't the
156 # least relevant for us, anyway.
157 "/wd4373",
158 ]
159 }
160}
161
mbonadei148d5a22017-04-28 05:24:50 -0700162rtc_source_set("test_support") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000163 visibility = [ "*" ]
mbonadei148d5a22017-04-28 05:24:50 -0700164 testonly = true
kjellander32c4a202016-08-30 02:53:49 -0700165
Mirko Bonadei65ce3112018-01-26 11:57:47 +0100166 all_dependent_configs = [
167 ":suppress_warning_4373",
168 "//third_party/googletest:gmock_config",
169 "//third_party/googletest:gtest_config",
170 ]
Patrik Höglund34924c22018-01-19 09:11:07 +0100171
mbonadei148d5a22017-04-28 05:24:50 -0700172 sources = [
173 "gmock.h",
174 "gtest.h",
mbonadei148d5a22017-04-28 05:24:50 -0700175 "testsupport/unittest_utils.h",
176 ]
177
mbonadeicd95a4e2017-08-23 23:55:54 -0700178 public_deps = [
179 ":fileutils",
180 ]
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200181 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700182 public_deps += [ ":test_support_objc" ]
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200183 }
184
mbonadei148d5a22017-04-28 05:24:50 -0700185 deps = [
186 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100187 "../:typedefs",
Edward Lemur936dfb12017-11-30 11:43:42 +0100188 "../api:array_view",
mbonadei148d5a22017-04-28 05:24:50 -0700189 "../common_video",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700190 "../rtc_base:gtest_prod",
191 "../rtc_base:rtc_base_approved",
mbonadei148d5a22017-04-28 05:24:50 -0700192 "../system_wrappers",
193 "//testing/gmock",
194 "//testing/gtest",
195 ]
196
mbonadei148d5a22017-04-28 05:24:50 -0700197 if (!build_with_chromium && is_clang) {
198 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
199 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
200 }
201
202 if (is_android) {
203 deps += [ "//base:base" ]
204 }
205
206 if (is_ios && !build_with_chromium) {
kthelgason36d658d2017-08-24 05:43:45 -0700207 deps += [ "../sdk:common_objc" ]
mbonadei148d5a22017-04-28 05:24:50 -0700208 }
209
210 if (rtc_use_memcheck) {
211 data = valgrind_webrtc_dependencies
kjellander32c4a202016-08-30 02:53:49 -0700212 }
213}
214
oprypinfbbba3f2017-09-25 08:34:41 -0700215if (rtc_include_tests) {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000216 rtc_source_set("test_main") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000217 visibility = [ "*" ]
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200218 testonly = true
Oleh Prypin5ab68542017-09-25 09:18:00 +0000219 sources = [
220 "test_main.cc",
221 ]
222
223 public_deps = [
224 ":test_support",
225 ]
226 deps = [
227 ":field_trial",
Edward Lemure66572b2018-01-05 15:34:09 +0100228 ":perf_test",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000229 "../rtc_base:rtc_base_approved",
Bjorn Tereliusedab3012018-01-31 17:23:40 +0100230 "../system_wrappers:field_trial_default",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000231 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000232 "../system_wrappers:runtime_enabled_features_default",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000233 "//testing/gtest",
mbonadei9452c622017-04-27 12:29:29 -0700234 ]
235 }
mbonadei9452c622017-04-27 12:29:29 -0700236
Oleh Prypin5ab68542017-09-25 09:18:00 +0000237 rtc_source_set("video_test_support") {
238 testonly = true
239
240 sources = [
241 "testsupport/frame_reader.h",
242 "testsupport/frame_writer.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000243 "testsupport/mock/mock_frame_reader.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000244 "testsupport/y4m_frame_writer.cc",
245 "testsupport/yuv_frame_reader.cc",
246 "testsupport/yuv_frame_writer.cc",
247 ]
248
249 deps = [
250 ":test_support",
251 ":video_test_common",
252 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100253 "../:typedefs",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000254 "../api:video_frame_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100255 "../api:video_frame_api_i420",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000256 "../common_video",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100257 "../rtc_base:checks",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000258 "../rtc_base:rtc_base_approved",
259 "../system_wrappers",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000260 "//testing/gtest",
Mirko Bonadei401d0562017-12-14 11:24:00 +0100261 "//third_party/libyuv",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000262 ]
263
264 if (!is_ios) {
265 deps += [ "//third_party:jpeg" ]
266 sources += [ "testsupport/jpeg_frame_writer.cc" ]
267 } else {
268 sources += [ "testsupport/jpeg_frame_writer_ios.cc" ]
269 }
270
271 public_deps = [
272 ":fileutils",
273 ]
274
275 if (!build_with_chromium && is_clang) {
276 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
277 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
278 }
279
280 if (is_android) {
281 deps += [ "//base:base" ]
282 }
283
284 if (is_ios) {
285 deps += [ "../sdk:common_objc" ]
286 }
287
288 if (rtc_use_memcheck) {
289 data = valgrind_webrtc_dependencies
290 }
291 }
292
Edward Lemuraf8659a2017-09-27 14:46:24 +0200293 rtc_source_set("test_support_test_artifacts") {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000294 testonly = true
295 sources = [
Edward Lemuraf8659a2017-09-27 14:46:24 +0200296 "testsupport/test_artifacts.cc",
297 "testsupport/test_artifacts.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000298 ]
299 deps = [
300 ":fileutils",
301 "../rtc_base:rtc_base_approved",
302 ]
303 }
304
305 test_support_unittests_resources = [
306 "../resources/foreman_cif_short.yuv",
307 "../resources/video_coding/frame-ethernet-ii.pcap",
308 "../resources/video_coding/frame-loopback.pcap",
309 "../resources/video_coding/pltype103.rtp",
310 "../resources/video_coding/pltype103_header_only.rtp",
311 "../resources/video_coding/ssrcs-2.pcap",
312 "../resources/video_coding/ssrcs-3.pcap",
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200313 ]
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200314
315 if (is_ios) {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000316 bundle_data("test_support_unittests_bundle_data") {
317 testonly = true
318 sources = test_support_unittests_resources
319 outputs = [
320 "{{bundle_resources_dir}}/{{source_file_part}}",
321 ]
322 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200323 }
324
Oleh Prypin5ab68542017-09-25 09:18:00 +0000325 rtc_test("test_support_unittests") {
326 deps = [
Artem Titov6723cdc2018-03-05 15:36:09 +0000327 ":fake_audio_device",
Edward Lemure66572b2018-01-05 15:34:09 +0100328 ":perf_test",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000329 ":rtp_test_utils",
330 "../api:video_frame_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100331 "../api:video_frame_api_i420",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000332 "../call:call_interfaces",
333 "../common_audio",
334 "../modules/rtp_rtcp",
335 "../rtc_base:rtc_base_approved",
336 "../system_wrappers",
337 ]
338 sources = [
Oleh Prypin5ab68542017-09-25 09:18:00 +0000339 "fake_network_pipe_unittest.cc",
340 "frame_generator_unittest.cc",
341 "rtp_file_reader_unittest.cc",
342 "rtp_file_writer_unittest.cc",
343 "single_threaded_task_queue_unittest.cc",
344 "testsupport/always_passing_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000345 "testsupport/perf_test_unittest.cc",
Edward Lemuraf8659a2017-09-27 14:46:24 +0200346 "testsupport/test_artifacts_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000347 "testsupport/y4m_frame_writer_unittest.cc",
348 "testsupport/yuv_frame_reader_unittest.cc",
349 "testsupport/yuv_frame_writer_unittest.cc",
350 ]
351
352 # TODO(jschuh): Bug 1348: fix this warning.
353 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
354
Oleh Prypin5ab68542017-09-25 09:18:00 +0000355 if (!build_with_chromium && is_clang) {
356 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
357 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
358 }
359
360 data = test_support_unittests_resources
361 if (is_android) {
362 deps += [ "//testing/android/native_test:native_test_support" ]
363 shard_timeout = 900
364 }
365
366 if (is_ios) {
367 deps += [ ":test_support_unittests_bundle_data" ]
368 }
369
370 deps += [
371 ":direct_transport",
372 ":fileutils_unittests",
373 ":test_common",
374 ":test_main",
Edward Lemuraf8659a2017-09-27 14:46:24 +0200375 ":test_support_test_artifacts",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000376 ":video_test_common",
377 ":video_test_support",
378 "../modules/video_capture",
379 "../rtc_base:rtc_base_approved",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000380 "//testing/gtest",
381 ]
382 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200383}
384
mbonadeicd95a4e2017-08-23 23:55:54 -0700385if (is_ios) {
386 rtc_source_set("fileutils_objc") {
mbonadei9c296b32017-09-05 05:11:41 -0700387 visibility = [ ":fileutils" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700388 sources = [
389 "testsupport/iosfileutils.mm",
390 ]
391 deps = [
Patrik Höglund3e113432017-12-15 14:40:10 +0100392 "..:typedefs",
mbonadeicd95a4e2017-08-23 23:55:54 -0700393 "..:webrtc_common",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100394 "../rtc_base:checks",
mbonadeicd95a4e2017-08-23 23:55:54 -0700395 "../rtc_base:rtc_base_approved",
kthelgason36d658d2017-08-24 05:43:45 -0700396 "../sdk:common_objc",
mbonadeicd95a4e2017-08-23 23:55:54 -0700397 ]
398 }
399}
400
mbonadei9452c622017-04-27 12:29:29 -0700401rtc_source_set("fileutils") {
402 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700403 visibility = [
404 ":fileutils_unittests",
Edward Lemuraf8659a2017-09-27 14:46:24 +0200405 ":test_support_test_artifacts",
mbonadei9c296b32017-09-05 05:11:41 -0700406 ":test_support",
407 ":video_test_support",
408 ]
mbonadei9452c622017-04-27 12:29:29 -0700409 sources = [
410 "testsupport/fileutils.cc",
411 "testsupport/fileutils.h",
412 ]
mbonadei3edccb92017-06-01 04:47:20 -0700413 deps = [
414 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100415 "../:typedefs",
kwiberg84f6a3f2017-09-05 08:43:13 -0700416 "../api:optional",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100417 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700418 "../rtc_base:rtc_base_approved",
mbonadei3edccb92017-06-01 04:47:20 -0700419 ]
mbonadei9452c622017-04-27 12:29:29 -0700420 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700421 deps += [ ":fileutils_objc" ]
mbonadei3edccb92017-06-01 04:47:20 -0700422 }
423 if (is_win) {
ehmaldonadof6a861a2017-07-19 10:40:47 -0700424 deps += [ "../rtc_base:rtc_base" ]
mbonadei9452c622017-04-27 12:29:29 -0700425 }
mbonadei9452c622017-04-27 12:29:29 -0700426}
427
428rtc_source_set("run_test") {
429 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700430 if (is_mac) {
431 public_deps = [
432 ":run_test_objc",
433 ]
434 } else {
435 public_deps = [
436 ":run_test_generic",
437 ]
438 }
439}
440
441rtc_source_set("run_test_interface") {
mbonadei9452c622017-04-27 12:29:29 -0700442 sources = [
443 "run_test.h",
444 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700445}
446
447if (is_mac) {
448 rtc_source_set("run_test_objc") {
449 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700450 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700451 sources = [
452 "mac/run_test.mm",
453 ]
mbonadei9c296b32017-09-05 05:11:41 -0700454 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700455 ":run_test_interface",
456 ]
mbonadei9452c622017-04-27 12:29:29 -0700457 }
458}
459
mbonadeicd95a4e2017-08-23 23:55:54 -0700460rtc_source_set("run_test_generic") {
461 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700462 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700463 sources = [
464 "run_test.cc",
465 ]
mbonadei9c296b32017-09-05 05:11:41 -0700466 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700467 ":run_test_interface",
468 ]
469}
470
ehmaldonado37535bf2016-12-05 06:42:45 -0800471rtc_source_set("fileutils_unittests") {
472 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700473 visibility = [ ":*" ] # Only targets in this file can depend on this.
ehmaldonado37535bf2016-12-05 06:42:45 -0800474 sources = [
475 "testsupport/fileutils_unittest.cc",
476 ]
477 deps = [
478 ":fileutils",
mbonadei3edccb92017-06-01 04:47:20 -0700479 ":test_support",
kwiberg84f6a3f2017-09-05 08:43:13 -0700480 "../api:optional",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100481 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700482 "../rtc_base:rtc_base_approved",
ehmaldonado37535bf2016-12-05 06:42:45 -0800483 "//testing/gtest",
484 ]
485}
kjellander0f380d82016-06-01 04:48:26 -0700486
perkj488c5dc2017-02-08 05:55:51 -0800487rtc_source_set("direct_transport") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000488 visibility = [ "*" ]
perkj488c5dc2017-02-08 05:55:51 -0800489 testonly = true
490 sources = [
491 "direct_transport.cc",
492 "direct_transport.h",
493 "fake_network_pipe.cc",
494 "fake_network_pipe.h",
495 ]
496 if (!build_with_chromium && is_clang) {
497 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
498 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
499 }
500 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700501 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100502 "../:typedefs",
perkj488c5dc2017-02-08 05:55:51 -0800503 "../api:transport_api",
perkj488c5dc2017-02-08 05:55:51 -0800504 "../call",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100505 "../call:call_interfaces",
mbonadei3edccb92017-06-01 04:47:20 -0700506 "../modules/rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700507 "../rtc_base:rtc_base_approved",
eladalon413ee9a2017-08-22 04:02:52 -0700508 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700509 "../system_wrappers",
perkj488c5dc2017-02-08 05:55:51 -0800510 ]
eladalon413ee9a2017-08-22 04:02:52 -0700511 public_deps = [
512 ":single_threaded_task_queue",
513 ]
514}
515
516rtc_source_set("single_threaded_task_queue") {
517 testonly = true
518 sources = [
519 "single_threaded_task_queue.cc",
520 "single_threaded_task_queue.h",
521 ]
522 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100523 "../rtc_base:checks",
eladalon413ee9a2017-08-22 04:02:52 -0700524 "../rtc_base:rtc_base_approved",
525 ]
perkj488c5dc2017-02-08 05:55:51 -0800526}
527
perkj16ccfdf2017-02-28 14:41:05 -0800528rtc_source_set("fake_audio_device") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000529 visibility = [ "*" ]
perkj16ccfdf2017-02-28 14:41:05 -0800530 testonly = true
531 sources = [
perkj16ccfdf2017-02-28 14:41:05 -0800532 "fake_audio_device.h",
533 ]
534 if (!build_with_chromium && is_clang) {
535 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
536 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
537 }
538 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700539 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100540 "../:typedefs",
kwiberg529662a2017-09-04 05:43:17 -0700541 "../api:array_view",
mbonadei3edccb92017-06-01 04:47:20 -0700542 "../common_audio:common_audio",
Artem Titov0f039732018-03-07 12:20:51 +0100543 "../modules/audio_device",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100544 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700545 "../rtc_base:rtc_base_approved",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100546 "../system_wrappers",
perkj16ccfdf2017-02-28 14:41:05 -0800547 ]
548}
549
ehmaldonado38a21322016-09-02 04:10:34 -0700550rtc_source_set("test_common") {
kjellander0f380d82016-06-01 04:48:26 -0700551 testonly = true
552 sources = [
553 "call_test.cc",
554 "call_test.h",
555 "configurable_frame_size_encoder.cc",
556 "configurable_frame_size_encoder.h",
557 "constants.cc",
558 "constants.h",
kjellander0f380d82016-06-01 04:48:26 -0700559 "drifting_clock.cc",
560 "drifting_clock.h",
561 "encoder_settings.cc",
562 "encoder_settings.h",
kjellander0f380d82016-06-01 04:48:26 -0700563 "fake_decoder.cc",
564 "fake_decoder.h",
565 "fake_encoder.cc",
566 "fake_encoder.h",
sakal55d932b2016-09-30 06:19:08 -0700567 "fake_videorenderer.h",
kjellander0f380d82016-06-01 04:48:26 -0700568 "layer_filtering_transport.cc",
569 "layer_filtering_transport.h",
Danil Chapovalovdd7e2842018-03-09 15:37:03 +0000570 "mock_transport.cc",
kjellander0f380d82016-06-01 04:48:26 -0700571 "mock_transport.h",
kjellander0f380d82016-06-01 04:48:26 -0700572 "null_transport.cc",
573 "null_transport.h",
574 "rtp_rtcp_observer.h",
575 "statistics.cc",
576 "statistics.h",
kjellander0f380d82016-06-01 04:48:26 -0700577 "win/run_loop_win.cc",
578 ]
579 if (!is_win) {
580 sources += [
581 "run_loop.cc",
582 "run_loop.h",
583 ]
584 }
585
kjellandere40a7ee2016-10-16 23:56:12 -0700586 if (!build_with_chromium && is_clang) {
587 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700588 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700589 }
590
591 deps = [
perkj488c5dc2017-02-08 05:55:51 -0800592 ":direct_transport",
Artem Titov6723cdc2018-03-05 15:36:09 +0000593 ":fake_audio_device",
kjellander0f380d82016-06-01 04:48:26 -0700594 ":rtp_test_utils",
595 ":test_support",
perkjc5726c12017-03-01 03:37:08 -0800596 ":video_test_common",
kjellander0f380d82016-06-01 04:48:26 -0700597 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100598 "../:typedefs",
Patrik Höglundbe214a22018-01-04 12:14:35 +0100599 "../api:libjingle_peerconnection_api",
mbonadei3edccb92017-06-01 04:47:20 -0700600 "../api:transport_api",
601 "../api:video_frame_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100602 "../api:video_frame_api_i420",
mbonadei3edccb92017-06-01 04:47:20 -0700603 "../api/audio_codecs:builtin_audio_decoder_factory",
ossueb1fde42017-05-02 06:46:30 -0700604 "../api/audio_codecs:builtin_audio_encoder_factory",
ilnikd60d06a2017-04-05 03:02:20 -0700605 "../api/video_codecs:video_codecs_api",
kjellander94cee312016-06-10 01:56:57 -0700606 "../audio",
kjellander94cee312016-06-10 01:56:57 -0700607 "../call",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100608 "../call:call_interfaces",
sprangdb2a9fc2017-08-09 06:42:32 -0700609 "../call:rtp_sender",
aleloi440b6d92017-08-22 05:43:23 -0700610 "../call:video_stream_api",
mbonadei3edccb92017-06-01 04:47:20 -0700611 "../common_video",
612 "../logging:rtc_event_log_api",
Qingsi Wang970b0882018-02-01 11:04:46 -0800613 "../logging:rtc_event_log_impl_base",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100614 "../media:rtc_media_base",
mbonadei3edccb92017-06-01 04:47:20 -0700615 "../modules/audio_device:mock_audio_device",
aleloi10111bc2016-11-17 06:48:48 -0800616 "../modules/audio_mixer:audio_mixer_impl",
aleloidd310712016-11-17 06:28:59 -0800617 "../modules/audio_processing",
mbonadei3edccb92017-06-01 04:47:20 -0700618 "../modules/rtp_rtcp",
619 "../modules/rtp_rtcp:mock_rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100620 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglund99175c62018-01-08 11:05:10 +0100621 "../modules/video_coding:video_codec_interface",
charujaincb728ea2017-09-18 03:08:08 -0700622 "../modules/video_coding:video_coding_utility",
mbonadei3edccb92017-06-01 04:47:20 -0700623 "../modules/video_coding:webrtc_h264",
624 "../modules/video_coding:webrtc_vp8",
625 "../modules/video_coding:webrtc_vp9",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100626 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700627 "../rtc_base:rtc_base_approved",
628 "../rtc_base:rtc_task_queue",
629 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700630 "../system_wrappers",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100631 "../system_wrappers:field_trial_api",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000632 "../system_wrappers:runtime_enabled_features_api",
kjellander94cee312016-06-10 01:56:57 -0700633 "../video",
kjellander0f380d82016-06-01 04:48:26 -0700634 "//testing/gtest",
kjellander0f380d82016-06-01 04:48:26 -0700635 ]
mbonadei148d5a22017-04-28 05:24:50 -0700636 if (!is_android && !build_with_chromium) {
oprypin92220ff2017-03-23 03:40:03 -0700637 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
638 }
kjellander0f380d82016-06-01 04:48:26 -0700639}
640
641config("test_renderer_exported_config") {
642 if (is_win && is_clang) {
643 # GN orders flags on a target before flags from configs. The default config
644 # adds -Wall, and this flag have to be after -Wall -- so they need to
645 # come from a config and cannot be on the target directly.
ehmaldonado4bc4d272016-08-25 04:15:40 -0700646 cflags = [
kjellander0f380d82016-06-01 04:48:26 -0700647 "-Wno-bool-conversion",
648 "-Wno-comment",
649 "-Wno-delete-non-virtual-dtor",
650 ]
651 }
652}
653
ehmaldonado38a21322016-09-02 04:10:34 -0700654rtc_source_set("test_renderer") {
mbonadei9c296b32017-09-05 05:11:41 -0700655 public_deps = [
656 ":test_renderer_generic",
657 ]
kjellander0f380d82016-06-01 04:48:26 -0700658 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700659 if (is_mac) {
mbonadei9c296b32017-09-05 05:11:41 -0700660 public_deps += [ ":test_renderer_objc" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700661 }
662}
663
664if (is_mac) {
665 rtc_source_set("test_renderer_objc") {
666 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700667 visibility = [ ":test_renderer" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700668 sources = [
669 "mac/video_renderer_mac.h",
670 "mac/video_renderer_mac.mm",
671 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700672 deps = [
mbonadei9c296b32017-09-05 05:11:41 -0700673 ":test_renderer_generic",
mbonadeicd95a4e2017-08-23 23:55:54 -0700674 "../rtc_base:rtc_base_approved",
675 ]
676 libs = [
677 "Cocoa.framework",
678 "OpenGL.framework",
679 "CoreVideo.framework",
680 ]
681 if (!build_with_chromium && is_clang) {
682 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
683 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
684 }
685 }
686}
687
688rtc_source_set("test_renderer_generic") {
689 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700690 visibility = [
691 ":test_renderer",
692 ":test_renderer_objc",
693 ]
kjellander0f380d82016-06-01 04:48:26 -0700694 libs = []
695 sources = [
kjellander0f380d82016-06-01 04:48:26 -0700696 "video_renderer.cc",
697 "video_renderer.h",
698 "win/d3d_renderer.cc",
699 "win/d3d_renderer.h",
700 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700701 deps = [
702 ":test_support",
703 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100704 "../:typedefs",
Niels Möller9d138fc2018-02-15 16:58:43 +0100705 "../api:video_frame_api",
mbonadeicd95a4e2017-08-23 23:55:54 -0700706 "../common_video",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100707 "../media:rtc_media_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100708 "../rtc_base:checks",
mbonadeicd95a4e2017-08-23 23:55:54 -0700709 "../rtc_base:rtc_base_approved",
710 "//testing/gtest",
711 ]
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100712 if (!(is_linux && rtc_use_x11) && !is_mac && !is_win) {
kjellander0f380d82016-06-01 04:48:26 -0700713 sources += [ "null_platform_renderer.cc" ]
714 }
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100715 if ((is_linux && rtc_use_x11) || is_mac) {
kjellander0f380d82016-06-01 04:48:26 -0700716 sources += [
717 "gl/gl_renderer.cc",
718 "gl/gl_renderer.h",
719 ]
720 }
721
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100722 if (is_linux && rtc_use_x11) {
Edward Lemur84a87c42017-11-07 19:07:31 +0100723 sources += [
724 "linux/glx_renderer.cc",
725 "linux/glx_renderer.h",
726 "linux/video_renderer_linux.cc",
727 ]
kjellander0f380d82016-06-01 04:48:26 -0700728 libs += [
729 "Xext",
730 "X11",
731 "GL",
732 ]
733 }
734 if (is_android) {
735 libs += [
736 "GLESv2",
737 "log",
738 ]
739 }
kjellander0f380d82016-06-01 04:48:26 -0700740
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700741 public_configs = [ ":test_renderer_exported_config" ]
kjellander0f380d82016-06-01 04:48:26 -0700742
kjellandere40a7ee2016-10-16 23:56:12 -0700743 if (!build_with_chromium && is_clang) {
744 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700745 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700746 }
kjellander0f380d82016-06-01 04:48:26 -0700747}
kwiberg37e99fd2017-04-10 05:15:48 -0700748
749rtc_source_set("audio_codec_mocks") {
750 testonly = true
751 sources = [
kwiberg2b3aa142017-06-14 03:31:17 -0700752 "mock_audio_decoder.cc",
kwiberg37e99fd2017-04-10 05:15:48 -0700753 "mock_audio_decoder.h",
754 "mock_audio_decoder_factory.h",
ossueb1fde42017-05-02 06:46:30 -0700755 "mock_audio_encoder.cc",
756 "mock_audio_encoder.h",
757 "mock_audio_encoder_factory.h",
758 ]
759
760 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700761 ":test_support",
kwiberg529662a2017-09-04 05:43:17 -0700762 "../api:array_view",
ossueb1fde42017-05-02 06:46:30 -0700763 "../api/audio_codecs:audio_codecs_api",
mbonadei3edccb92017-06-01 04:47:20 -0700764 "../api/audio_codecs:builtin_audio_decoder_factory",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700765 "../rtc_base:rtc_base_approved",
kwiberg37e99fd2017-04-10 05:15:48 -0700766 ]
767}
sakald7fdb802017-05-26 01:51:53 -0700768
769if (!build_with_chromium && is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000770 rtc_android_library("native_test_java") {
sakald7fdb802017-05-26 01:51:53 -0700771 testonly = true
772 java_files = [
773 "android/org/webrtc/native_test/RTCNativeUnitTest.java",
774 "android/org/webrtc/native_test/RTCNativeUnitTestActivity.java",
775 ]
776 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700777 "../rtc_base:base_java",
sakald7fdb802017-05-26 01:51:53 -0700778 "//testing/android/native_test:native_test_java",
sakald7fdb802017-05-26 01:51:53 -0700779 ]
780 }
781}