blob: c69ad08eb8a99e70d88cf6119e231a6dba82ade8 [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
Patrik Höglund7696bef2018-03-15 15:05:39 +0100178 public_deps = []
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200179 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700180 public_deps += [ ":test_support_objc" ]
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200181 }
182
mbonadei148d5a22017-04-28 05:24:50 -0700183 deps = [
ehmaldonadof6a861a2017-07-19 10:40:47 -0700184 "../rtc_base:rtc_base_approved",
mbonadei148d5a22017-04-28 05:24:50 -0700185 "//testing/gmock",
186 "//testing/gtest",
187 ]
188
mbonadei148d5a22017-04-28 05:24:50 -0700189 if (!build_with_chromium && is_clang) {
190 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
191 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
192 }
193
mbonadei148d5a22017-04-28 05:24:50 -0700194 if (is_ios && !build_with_chromium) {
kthelgason36d658d2017-08-24 05:43:45 -0700195 deps += [ "../sdk:common_objc" ]
mbonadei148d5a22017-04-28 05:24:50 -0700196 }
197
198 if (rtc_use_memcheck) {
199 data = valgrind_webrtc_dependencies
kjellander32c4a202016-08-30 02:53:49 -0700200 }
201}
202
oprypinfbbba3f2017-09-25 08:34:41 -0700203if (rtc_include_tests) {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000204 rtc_source_set("test_main") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000205 visibility = [ "*" ]
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200206 testonly = true
Oleh Prypin5ab68542017-09-25 09:18:00 +0000207 sources = [
208 "test_main.cc",
209 ]
210
211 public_deps = [
212 ":test_support",
213 ]
214 deps = [
215 ":field_trial",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100216 ":fileutils",
Edward Lemure66572b2018-01-05 15:34:09 +0100217 ":perf_test",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000218 "../rtc_base:rtc_base_approved",
Bjorn Tereliusedab3012018-01-31 17:23:40 +0100219 "../system_wrappers:field_trial_default",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000220 "../system_wrappers:metrics_default",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000221 "../system_wrappers:runtime_enabled_features_default",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000222 "//testing/gtest",
mbonadei9452c622017-04-27 12:29:29 -0700223 ]
224 }
mbonadei9452c622017-04-27 12:29:29 -0700225
Oleh Prypin5ab68542017-09-25 09:18:00 +0000226 rtc_source_set("video_test_support") {
227 testonly = true
228
229 sources = [
230 "testsupport/frame_reader.h",
231 "testsupport/frame_writer.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000232 "testsupport/mock/mock_frame_reader.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000233 "testsupport/y4m_frame_writer.cc",
234 "testsupport/yuv_frame_reader.cc",
235 "testsupport/yuv_frame_writer.cc",
236 ]
237
238 deps = [
Patrik Höglund7696bef2018-03-15 15:05:39 +0100239 ":fileutils",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000240 ":test_support",
241 ":video_test_common",
242 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100243 "../:typedefs",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000244 "../api:video_frame_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100245 "../api:video_frame_api_i420",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000246 "../common_video",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100247 "../rtc_base:checks",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000248 "../rtc_base:rtc_base_approved",
249 "../system_wrappers",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000250 "//testing/gtest",
Mirko Bonadei401d0562017-12-14 11:24:00 +0100251 "//third_party/libyuv",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000252 ]
253
254 if (!is_ios) {
255 deps += [ "//third_party:jpeg" ]
256 sources += [ "testsupport/jpeg_frame_writer.cc" ]
257 } else {
258 sources += [ "testsupport/jpeg_frame_writer_ios.cc" ]
259 }
260
Oleh Prypin5ab68542017-09-25 09:18:00 +0000261 if (!build_with_chromium && is_clang) {
262 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
263 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
264 }
265
266 if (is_android) {
267 deps += [ "//base:base" ]
268 }
269
270 if (is_ios) {
271 deps += [ "../sdk:common_objc" ]
272 }
273
274 if (rtc_use_memcheck) {
275 data = valgrind_webrtc_dependencies
276 }
277 }
278
Edward Lemuraf8659a2017-09-27 14:46:24 +0200279 rtc_source_set("test_support_test_artifacts") {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000280 testonly = true
281 sources = [
Edward Lemuraf8659a2017-09-27 14:46:24 +0200282 "testsupport/test_artifacts.cc",
283 "testsupport/test_artifacts.h",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000284 ]
285 deps = [
286 ":fileutils",
287 "../rtc_base:rtc_base_approved",
288 ]
289 }
290
291 test_support_unittests_resources = [
292 "../resources/foreman_cif_short.yuv",
293 "../resources/video_coding/frame-ethernet-ii.pcap",
294 "../resources/video_coding/frame-loopback.pcap",
295 "../resources/video_coding/pltype103.rtp",
296 "../resources/video_coding/pltype103_header_only.rtp",
297 "../resources/video_coding/ssrcs-2.pcap",
298 "../resources/video_coding/ssrcs-3.pcap",
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200299 ]
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200300
301 if (is_ios) {
Oleh Prypin5ab68542017-09-25 09:18:00 +0000302 bundle_data("test_support_unittests_bundle_data") {
303 testonly = true
304 sources = test_support_unittests_resources
305 outputs = [
306 "{{bundle_resources_dir}}/{{source_file_part}}",
307 ]
308 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200309 }
310
Oleh Prypin5ab68542017-09-25 09:18:00 +0000311 rtc_test("test_support_unittests") {
312 deps = [
Sebastian Jansson09408112018-04-24 14:41:22 +0200313 ":direct_transport",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100314 ":fileutils",
Edward Lemure66572b2018-01-05 15:34:09 +0100315 ":perf_test",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000316 ":rtp_test_utils",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200317 ":test_main",
318 ":test_support",
319 ":test_support_test_artifacts",
320 ":video_test_common",
321 ":video_test_support",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100322 "../api:video_frame_api_i420",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200323 "../modules/rtp_rtcp:rtp_rtcp",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000324 "../rtc_base:rtc_base_approved",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200325 "../test:single_threaded_task_queue",
326 "//testing/gtest",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000327 ]
328 sources = [
Sebastian Jansson09408112018-04-24 14:41:22 +0200329 "direct_transport_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000330 "frame_generator_unittest.cc",
331 "rtp_file_reader_unittest.cc",
332 "rtp_file_writer_unittest.cc",
333 "single_threaded_task_queue_unittest.cc",
334 "testsupport/always_passing_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000335 "testsupport/perf_test_unittest.cc",
Edward Lemuraf8659a2017-09-27 14:46:24 +0200336 "testsupport/test_artifacts_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000337 "testsupport/y4m_frame_writer_unittest.cc",
338 "testsupport/yuv_frame_reader_unittest.cc",
339 "testsupport/yuv_frame_writer_unittest.cc",
340 ]
341
342 # TODO(jschuh): Bug 1348: fix this warning.
343 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
344
Oleh Prypin5ab68542017-09-25 09:18:00 +0000345 if (!build_with_chromium && is_clang) {
346 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
347 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
348 }
349
350 data = test_support_unittests_resources
351 if (is_android) {
352 deps += [ "//testing/android/native_test:native_test_support" ]
353 shard_timeout = 900
354 }
355
356 if (is_ios) {
357 deps += [ ":test_support_unittests_bundle_data" ]
358 }
Mirko Bonadei9098b302018-04-06 10:48:10 +0200359 if (!is_android && !build_with_chromium) {
360 # This is needed in order to avoid:
361 # undefined symbol: webrtc::videocapturemodule::VideoCaptureImpl::Create
362 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
363 }
Oleh Prypin5ab68542017-09-25 09:18:00 +0000364 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200365}
366
mbonadeicd95a4e2017-08-23 23:55:54 -0700367if (is_ios) {
368 rtc_source_set("fileutils_objc") {
mbonadei9c296b32017-09-05 05:11:41 -0700369 visibility = [ ":fileutils" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700370 sources = [
371 "testsupport/iosfileutils.mm",
372 ]
373 deps = [
Patrik Höglund3e113432017-12-15 14:40:10 +0100374 "..:typedefs",
mbonadeicd95a4e2017-08-23 23:55:54 -0700375 "..:webrtc_common",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100376 "../rtc_base:checks",
mbonadeicd95a4e2017-08-23 23:55:54 -0700377 "../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
Patrik Höglund7696bef2018-03-15 15:05:39 +0100385 visibility = [ "*" ]
mbonadei9452c622017-04-27 12:29:29 -0700386 sources = [
387 "testsupport/fileutils.cc",
388 "testsupport/fileutils.h",
389 ]
mbonadei3edccb92017-06-01 04:47:20 -0700390 deps = [
391 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100392 "../:typedefs",
kwiberg84f6a3f2017-09-05 08:43:13 -0700393 "../api:optional",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100394 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700395 "../rtc_base:rtc_base_approved",
mbonadei3edccb92017-06-01 04:47:20 -0700396 ]
mbonadei9452c622017-04-27 12:29:29 -0700397 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700398 deps += [ ":fileutils_objc" ]
mbonadei3edccb92017-06-01 04:47:20 -0700399 }
400 if (is_win) {
ehmaldonadof6a861a2017-07-19 10:40:47 -0700401 deps += [ "../rtc_base:rtc_base" ]
mbonadei9452c622017-04-27 12:29:29 -0700402 }
mbonadei9452c622017-04-27 12:29:29 -0700403}
404
405rtc_source_set("run_test") {
406 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700407 if (is_mac) {
408 public_deps = [
409 ":run_test_objc",
410 ]
411 } else {
412 public_deps = [
413 ":run_test_generic",
414 ]
415 }
416}
417
418rtc_source_set("run_test_interface") {
mbonadei9452c622017-04-27 12:29:29 -0700419 sources = [
420 "run_test.h",
421 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700422}
423
424if (is_mac) {
425 rtc_source_set("run_test_objc") {
426 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700427 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700428 sources = [
429 "mac/run_test.mm",
430 ]
mbonadei9c296b32017-09-05 05:11:41 -0700431 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700432 ":run_test_interface",
433 ]
mbonadei9452c622017-04-27 12:29:29 -0700434 }
435}
436
mbonadeicd95a4e2017-08-23 23:55:54 -0700437rtc_source_set("run_test_generic") {
438 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700439 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700440 sources = [
441 "run_test.cc",
442 ]
mbonadei9c296b32017-09-05 05:11:41 -0700443 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700444 ":run_test_interface",
445 ]
446}
447
ehmaldonado37535bf2016-12-05 06:42:45 -0800448rtc_source_set("fileutils_unittests") {
449 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700450 visibility = [ ":*" ] # Only targets in this file can depend on this.
ehmaldonado37535bf2016-12-05 06:42:45 -0800451 sources = [
452 "testsupport/fileutils_unittest.cc",
453 ]
454 deps = [
455 ":fileutils",
mbonadei3edccb92017-06-01 04:47:20 -0700456 ":test_support",
kwiberg84f6a3f2017-09-05 08:43:13 -0700457 "../api:optional",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100458 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700459 "../rtc_base:rtc_base_approved",
ehmaldonado37535bf2016-12-05 06:42:45 -0800460 "//testing/gtest",
461 ]
462}
kjellander0f380d82016-06-01 04:48:26 -0700463
perkj488c5dc2017-02-08 05:55:51 -0800464rtc_source_set("direct_transport") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000465 visibility = [ "*" ]
perkj488c5dc2017-02-08 05:55:51 -0800466 testonly = true
467 sources = [
468 "direct_transport.cc",
469 "direct_transport.h",
perkj488c5dc2017-02-08 05:55:51 -0800470 ]
471 if (!build_with_chromium && is_clang) {
472 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
473 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
474 }
475 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700476 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100477 "../:typedefs",
perkj488c5dc2017-02-08 05:55:51 -0800478 "../api:transport_api",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100479 "../call:call_interfaces",
mbonadei3edccb92017-06-01 04:47:20 -0700480 "../modules/rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700481 "../rtc_base:rtc_base_approved",
eladalon413ee9a2017-08-22 04:02:52 -0700482 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700483 "../system_wrappers",
perkj488c5dc2017-02-08 05:55:51 -0800484 ]
eladalon413ee9a2017-08-22 04:02:52 -0700485 public_deps = [
486 ":single_threaded_task_queue",
Erik Språng09708512018-03-14 15:16:50 +0100487 "../call:fake_network",
eladalon413ee9a2017-08-22 04:02:52 -0700488 ]
489}
490
491rtc_source_set("single_threaded_task_queue") {
492 testonly = true
493 sources = [
494 "single_threaded_task_queue.cc",
495 "single_threaded_task_queue.h",
496 ]
497 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100498 "../rtc_base:checks",
eladalon413ee9a2017-08-22 04:02:52 -0700499 "../rtc_base:rtc_base_approved",
500 ]
perkj488c5dc2017-02-08 05:55:51 -0800501}
502
ehmaldonado38a21322016-09-02 04:10:34 -0700503rtc_source_set("test_common") {
kjellander0f380d82016-06-01 04:48:26 -0700504 testonly = true
505 sources = [
506 "call_test.cc",
507 "call_test.h",
508 "configurable_frame_size_encoder.cc",
509 "configurable_frame_size_encoder.h",
510 "constants.cc",
511 "constants.h",
kjellander0f380d82016-06-01 04:48:26 -0700512 "drifting_clock.cc",
513 "drifting_clock.h",
Niels Möller4db138e2018-04-19 09:04:13 +0200514 "encoder_proxy_factory.h",
kjellander0f380d82016-06-01 04:48:26 -0700515 "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",
Niels Möller4db138e2018-04-19 09:04:13 +0200522 "function_video_encoder_factory.h",
kjellander0f380d82016-06-01 04:48:26 -0700523 "layer_filtering_transport.cc",
524 "layer_filtering_transport.h",
Danil Chapovalovdd7e2842018-03-09 15:37:03 +0000525 "mock_transport.cc",
kjellander0f380d82016-06-01 04:48:26 -0700526 "mock_transport.h",
kjellander0f380d82016-06-01 04:48:26 -0700527 "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",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100548 ":fileutils",
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",
Patrik Höglund3e113432017-12-15 14:40:10 +0100553 "../:typedefs",
Patrik Höglundbe214a22018-01-04 12:14:35 +0100554 "../api:libjingle_peerconnection_api",
mbonadei3edccb92017-06-01 04:47:20 -0700555 "../api:transport_api",
556 "../api:video_frame_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100557 "../api:video_frame_api_i420",
mbonadei3edccb92017-06-01 04:47:20 -0700558 "../api/audio_codecs:builtin_audio_decoder_factory",
ossueb1fde42017-05-02 06:46:30 -0700559 "../api/audio_codecs:builtin_audio_encoder_factory",
ilnikd60d06a2017-04-05 03:02:20 -0700560 "../api/video_codecs:video_codecs_api",
kjellander94cee312016-06-10 01:56:57 -0700561 "../audio",
kjellander94cee312016-06-10 01:56:57 -0700562 "../call",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100563 "../call:call_interfaces",
sprangdb2a9fc2017-08-09 06:42:32 -0700564 "../call:rtp_sender",
aleloi440b6d92017-08-22 05:43:23 -0700565 "../call:video_stream_api",
mbonadei3edccb92017-06-01 04:47:20 -0700566 "../common_video",
567 "../logging:rtc_event_log_api",
Qingsi Wang970b0882018-02-01 11:04:46 -0800568 "../logging:rtc_event_log_impl_base",
Emircan Uysaler03e6ec92018-03-09 15:03:26 -0800569 "../media:rtc_internal_video_codecs",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100570 "../media:rtc_media_base",
Artem Titov3faa8322018-03-07 14:44:00 +0100571 "../modules/audio_device",
Paulina Hensman7bd79a02018-03-15 12:44:12 +0100572 "../modules/audio_device:audio_device_impl",
mbonadei3edccb92017-06-01 04:47:20 -0700573 "../modules/audio_device:mock_audio_device",
aleloi10111bc2016-11-17 06:48:48 -0800574 "../modules/audio_mixer:audio_mixer_impl",
aleloidd310712016-11-17 06:28:59 -0800575 "../modules/audio_processing",
mbonadei3edccb92017-06-01 04:47:20 -0700576 "../modules/rtp_rtcp",
577 "../modules/rtp_rtcp:mock_rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100578 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglund99175c62018-01-08 11:05:10 +0100579 "../modules/video_coding:video_codec_interface",
charujaincb728ea2017-09-18 03:08:08 -0700580 "../modules/video_coding:video_coding_utility",
mbonadei3edccb92017-06-01 04:47:20 -0700581 "../modules/video_coding:webrtc_h264",
Emircan Uysaler03e6ec92018-03-09 15:03:26 -0800582 "../modules/video_coding:webrtc_multiplex",
mbonadei3edccb92017-06-01 04:47:20 -0700583 "../modules/video_coding:webrtc_vp8",
584 "../modules/video_coding:webrtc_vp9",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100585 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700586 "../rtc_base:rtc_base_approved",
587 "../rtc_base:rtc_task_queue",
588 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700589 "../system_wrappers",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100590 "../system_wrappers:field_trial_api",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000591 "../system_wrappers:runtime_enabled_features_api",
kjellander94cee312016-06-10 01:56:57 -0700592 "../video",
kjellander0f380d82016-06-01 04:48:26 -0700593 "//testing/gtest",
kjellander0f380d82016-06-01 04:48:26 -0700594 ]
mbonadei148d5a22017-04-28 05:24:50 -0700595 if (!is_android && !build_with_chromium) {
oprypin92220ff2017-03-23 03:40:03 -0700596 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
597 }
kjellander0f380d82016-06-01 04:48:26 -0700598}
599
600config("test_renderer_exported_config") {
601 if (is_win && is_clang) {
602 # GN orders flags on a target before flags from configs. The default config
603 # adds -Wall, and this flag have to be after -Wall -- so they need to
604 # come from a config and cannot be on the target directly.
ehmaldonado4bc4d272016-08-25 04:15:40 -0700605 cflags = [
kjellander0f380d82016-06-01 04:48:26 -0700606 "-Wno-bool-conversion",
607 "-Wno-comment",
608 "-Wno-delete-non-virtual-dtor",
609 ]
610 }
611}
612
ehmaldonado38a21322016-09-02 04:10:34 -0700613rtc_source_set("test_renderer") {
mbonadei9c296b32017-09-05 05:11:41 -0700614 public_deps = [
615 ":test_renderer_generic",
616 ]
kjellander0f380d82016-06-01 04:48:26 -0700617 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700618 if (is_mac) {
mbonadei9c296b32017-09-05 05:11:41 -0700619 public_deps += [ ":test_renderer_objc" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700620 }
621}
622
623if (is_mac) {
624 rtc_source_set("test_renderer_objc") {
625 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700626 visibility = [ ":test_renderer" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700627 sources = [
628 "mac/video_renderer_mac.h",
629 "mac/video_renderer_mac.mm",
630 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700631 deps = [
mbonadei9c296b32017-09-05 05:11:41 -0700632 ":test_renderer_generic",
mbonadeicd95a4e2017-08-23 23:55:54 -0700633 "../rtc_base:rtc_base_approved",
634 ]
635 libs = [
636 "Cocoa.framework",
637 "OpenGL.framework",
638 "CoreVideo.framework",
639 ]
640 if (!build_with_chromium && is_clang) {
641 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
642 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
643 }
644 }
645}
646
647rtc_source_set("test_renderer_generic") {
648 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700649 visibility = [
650 ":test_renderer",
651 ":test_renderer_objc",
652 ]
kjellander0f380d82016-06-01 04:48:26 -0700653 libs = []
654 sources = [
kjellander0f380d82016-06-01 04:48:26 -0700655 "video_renderer.cc",
656 "video_renderer.h",
657 "win/d3d_renderer.cc",
658 "win/d3d_renderer.h",
659 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700660 deps = [
661 ":test_support",
662 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100663 "../:typedefs",
Niels Möller9d138fc2018-02-15 16:58:43 +0100664 "../api:video_frame_api",
mbonadeicd95a4e2017-08-23 23:55:54 -0700665 "../common_video",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100666 "../media:rtc_media_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100667 "../rtc_base:checks",
mbonadeicd95a4e2017-08-23 23:55:54 -0700668 "../rtc_base:rtc_base_approved",
669 "//testing/gtest",
670 ]
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100671 if (!(is_linux && rtc_use_x11) && !is_mac && !is_win) {
kjellander0f380d82016-06-01 04:48:26 -0700672 sources += [ "null_platform_renderer.cc" ]
673 }
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100674 if ((is_linux && rtc_use_x11) || is_mac) {
kjellander0f380d82016-06-01 04:48:26 -0700675 sources += [
676 "gl/gl_renderer.cc",
677 "gl/gl_renderer.h",
678 ]
679 }
680
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100681 if (is_linux && rtc_use_x11) {
Edward Lemur84a87c42017-11-07 19:07:31 +0100682 sources += [
683 "linux/glx_renderer.cc",
684 "linux/glx_renderer.h",
685 "linux/video_renderer_linux.cc",
686 ]
kjellander0f380d82016-06-01 04:48:26 -0700687 libs += [
688 "Xext",
689 "X11",
690 "GL",
691 ]
692 }
693 if (is_android) {
694 libs += [
695 "GLESv2",
696 "log",
697 ]
698 }
kjellander0f380d82016-06-01 04:48:26 -0700699
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700700 public_configs = [ ":test_renderer_exported_config" ]
kjellander0f380d82016-06-01 04:48:26 -0700701
kjellandere40a7ee2016-10-16 23:56:12 -0700702 if (!build_with_chromium && is_clang) {
703 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700704 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700705 }
kjellander0f380d82016-06-01 04:48:26 -0700706}
kwiberg37e99fd2017-04-10 05:15:48 -0700707
708rtc_source_set("audio_codec_mocks") {
709 testonly = true
710 sources = [
kwiberg2b3aa142017-06-14 03:31:17 -0700711 "mock_audio_decoder.cc",
kwiberg37e99fd2017-04-10 05:15:48 -0700712 "mock_audio_decoder.h",
713 "mock_audio_decoder_factory.h",
ossueb1fde42017-05-02 06:46:30 -0700714 "mock_audio_encoder.cc",
715 "mock_audio_encoder.h",
716 "mock_audio_encoder_factory.h",
717 ]
718
719 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700720 ":test_support",
kwiberg529662a2017-09-04 05:43:17 -0700721 "../api:array_view",
ossueb1fde42017-05-02 06:46:30 -0700722 "../api/audio_codecs:audio_codecs_api",
mbonadei3edccb92017-06-01 04:47:20 -0700723 "../api/audio_codecs:builtin_audio_decoder_factory",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700724 "../rtc_base:rtc_base_approved",
kwiberg37e99fd2017-04-10 05:15:48 -0700725 ]
726}
sakald7fdb802017-05-26 01:51:53 -0700727
728if (!build_with_chromium && is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000729 rtc_android_library("native_test_java") {
sakald7fdb802017-05-26 01:51:53 -0700730 testonly = true
731 java_files = [
732 "android/org/webrtc/native_test/RTCNativeUnitTest.java",
733 "android/org/webrtc/native_test/RTCNativeUnitTestActivity.java",
734 ]
735 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700736 "../rtc_base:base_java",
sakald7fdb802017-05-26 01:51:53 -0700737 "//testing/android/native_test:native_test_java",
sakald7fdb802017-05-26 01:51:53 -0700738 ]
739 }
740}