blob: ece4003acb0651013042c431adf2707499f501dc [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 = [
Patrik Höglund7696bef2018-03-15 15:05:39 +0100313 ":fileutils",
Edward Lemure66572b2018-01-05 15:34:09 +0100314 ":perf_test",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000315 ":rtp_test_utils",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200316 ":test_main",
317 ":test_support",
318 ":test_support_test_artifacts",
319 ":video_test_common",
320 ":video_test_support",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100321 "../api:video_frame_api_i420",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200322 "../modules/rtp_rtcp:rtp_rtcp",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000323 "../rtc_base:rtc_base_approved",
Mirko Bonadei9098b302018-04-06 10:48:10 +0200324 "../test:single_threaded_task_queue",
325 "//testing/gtest",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000326 ]
327 sources = [
Oleh Prypin5ab68542017-09-25 09:18:00 +0000328 "frame_generator_unittest.cc",
329 "rtp_file_reader_unittest.cc",
330 "rtp_file_writer_unittest.cc",
331 "single_threaded_task_queue_unittest.cc",
332 "testsupport/always_passing_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000333 "testsupport/perf_test_unittest.cc",
Edward Lemuraf8659a2017-09-27 14:46:24 +0200334 "testsupport/test_artifacts_unittest.cc",
Oleh Prypin5ab68542017-09-25 09:18:00 +0000335 "testsupport/y4m_frame_writer_unittest.cc",
336 "testsupport/yuv_frame_reader_unittest.cc",
337 "testsupport/yuv_frame_writer_unittest.cc",
338 ]
339
340 # TODO(jschuh): Bug 1348: fix this warning.
341 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
342
Oleh Prypin5ab68542017-09-25 09:18:00 +0000343 if (!build_with_chromium && is_clang) {
344 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
345 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
346 }
347
348 data = test_support_unittests_resources
349 if (is_android) {
350 deps += [ "//testing/android/native_test:native_test_support" ]
351 shard_timeout = 900
352 }
353
354 if (is_ios) {
355 deps += [ ":test_support_unittests_bundle_data" ]
356 }
Mirko Bonadei9098b302018-04-06 10:48:10 +0200357 if (!is_android && !build_with_chromium) {
358 # This is needed in order to avoid:
359 # undefined symbol: webrtc::videocapturemodule::VideoCaptureImpl::Create
360 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
361 }
Oleh Prypin5ab68542017-09-25 09:18:00 +0000362 }
Oleh Prypin90ce84e2017-09-25 10:27:22 +0200363}
364
mbonadeicd95a4e2017-08-23 23:55:54 -0700365if (is_ios) {
366 rtc_source_set("fileutils_objc") {
mbonadei9c296b32017-09-05 05:11:41 -0700367 visibility = [ ":fileutils" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700368 sources = [
369 "testsupport/iosfileutils.mm",
370 ]
371 deps = [
Patrik Höglund3e113432017-12-15 14:40:10 +0100372 "..:typedefs",
mbonadeicd95a4e2017-08-23 23:55:54 -0700373 "..:webrtc_common",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100374 "../rtc_base:checks",
mbonadeicd95a4e2017-08-23 23:55:54 -0700375 "../rtc_base:rtc_base_approved",
kthelgason36d658d2017-08-24 05:43:45 -0700376 "../sdk:common_objc",
mbonadeicd95a4e2017-08-23 23:55:54 -0700377 ]
378 }
379}
380
mbonadei9452c622017-04-27 12:29:29 -0700381rtc_source_set("fileutils") {
382 testonly = true
Patrik Höglund7696bef2018-03-15 15:05:39 +0100383 visibility = [ "*" ]
mbonadei9452c622017-04-27 12:29:29 -0700384 sources = [
385 "testsupport/fileutils.cc",
386 "testsupport/fileutils.h",
387 ]
mbonadei3edccb92017-06-01 04:47:20 -0700388 deps = [
389 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100390 "../:typedefs",
kwiberg84f6a3f2017-09-05 08:43:13 -0700391 "../api:optional",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100392 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700393 "../rtc_base:rtc_base_approved",
mbonadei3edccb92017-06-01 04:47:20 -0700394 ]
mbonadei9452c622017-04-27 12:29:29 -0700395 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700396 deps += [ ":fileutils_objc" ]
mbonadei3edccb92017-06-01 04:47:20 -0700397 }
398 if (is_win) {
ehmaldonadof6a861a2017-07-19 10:40:47 -0700399 deps += [ "../rtc_base:rtc_base" ]
mbonadei9452c622017-04-27 12:29:29 -0700400 }
mbonadei9452c622017-04-27 12:29:29 -0700401}
402
403rtc_source_set("run_test") {
404 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700405 if (is_mac) {
406 public_deps = [
407 ":run_test_objc",
408 ]
409 } else {
410 public_deps = [
411 ":run_test_generic",
412 ]
413 }
414}
415
416rtc_source_set("run_test_interface") {
mbonadei9452c622017-04-27 12:29:29 -0700417 sources = [
418 "run_test.h",
419 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700420}
421
422if (is_mac) {
423 rtc_source_set("run_test_objc") {
424 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700425 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700426 sources = [
427 "mac/run_test.mm",
428 ]
mbonadei9c296b32017-09-05 05:11:41 -0700429 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700430 ":run_test_interface",
431 ]
mbonadei9452c622017-04-27 12:29:29 -0700432 }
433}
434
mbonadeicd95a4e2017-08-23 23:55:54 -0700435rtc_source_set("run_test_generic") {
436 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700437 visibility = [ ":run_test" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700438 sources = [
439 "run_test.cc",
440 ]
mbonadei9c296b32017-09-05 05:11:41 -0700441 deps = [
mbonadeicd95a4e2017-08-23 23:55:54 -0700442 ":run_test_interface",
443 ]
444}
445
ehmaldonado37535bf2016-12-05 06:42:45 -0800446rtc_source_set("fileutils_unittests") {
447 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700448 visibility = [ ":*" ] # Only targets in this file can depend on this.
ehmaldonado37535bf2016-12-05 06:42:45 -0800449 sources = [
450 "testsupport/fileutils_unittest.cc",
451 ]
452 deps = [
453 ":fileutils",
mbonadei3edccb92017-06-01 04:47:20 -0700454 ":test_support",
kwiberg84f6a3f2017-09-05 08:43:13 -0700455 "../api:optional",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100456 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700457 "../rtc_base:rtc_base_approved",
ehmaldonado37535bf2016-12-05 06:42:45 -0800458 "//testing/gtest",
459 ]
460}
kjellander0f380d82016-06-01 04:48:26 -0700461
perkj488c5dc2017-02-08 05:55:51 -0800462rtc_source_set("direct_transport") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000463 visibility = [ "*" ]
perkj488c5dc2017-02-08 05:55:51 -0800464 testonly = true
465 sources = [
466 "direct_transport.cc",
467 "direct_transport.h",
perkj488c5dc2017-02-08 05:55:51 -0800468 ]
469 if (!build_with_chromium && is_clang) {
470 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
471 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
472 }
473 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700474 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100475 "../:typedefs",
perkj488c5dc2017-02-08 05:55:51 -0800476 "../api:transport_api",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100477 "../call:call_interfaces",
mbonadei3edccb92017-06-01 04:47:20 -0700478 "../modules/rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700479 "../rtc_base:rtc_base_approved",
eladalon413ee9a2017-08-22 04:02:52 -0700480 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700481 "../system_wrappers",
perkj488c5dc2017-02-08 05:55:51 -0800482 ]
eladalon413ee9a2017-08-22 04:02:52 -0700483 public_deps = [
484 ":single_threaded_task_queue",
Erik Språng09708512018-03-14 15:16:50 +0100485 "../call:fake_network",
eladalon413ee9a2017-08-22 04:02:52 -0700486 ]
487}
488
489rtc_source_set("single_threaded_task_queue") {
490 testonly = true
491 sources = [
492 "single_threaded_task_queue.cc",
493 "single_threaded_task_queue.h",
494 ]
495 deps = [
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100496 "../rtc_base:checks",
eladalon413ee9a2017-08-22 04:02:52 -0700497 "../rtc_base:rtc_base_approved",
498 ]
perkj488c5dc2017-02-08 05:55:51 -0800499}
500
ehmaldonado38a21322016-09-02 04:10:34 -0700501rtc_source_set("test_common") {
kjellander0f380d82016-06-01 04:48:26 -0700502 testonly = true
503 sources = [
504 "call_test.cc",
505 "call_test.h",
506 "configurable_frame_size_encoder.cc",
507 "configurable_frame_size_encoder.h",
508 "constants.cc",
509 "constants.h",
kjellander0f380d82016-06-01 04:48:26 -0700510 "drifting_clock.cc",
511 "drifting_clock.h",
Niels Möller4db138e2018-04-19 09:04:13 +0200512 "encoder_proxy_factory.h",
kjellander0f380d82016-06-01 04:48:26 -0700513 "encoder_settings.cc",
514 "encoder_settings.h",
kjellander0f380d82016-06-01 04:48:26 -0700515 "fake_decoder.cc",
516 "fake_decoder.h",
517 "fake_encoder.cc",
518 "fake_encoder.h",
sakal55d932b2016-09-30 06:19:08 -0700519 "fake_videorenderer.h",
Niels Möller4db138e2018-04-19 09:04:13 +0200520 "function_video_encoder_factory.h",
kjellander0f380d82016-06-01 04:48:26 -0700521 "layer_filtering_transport.cc",
522 "layer_filtering_transport.h",
Danil Chapovalovdd7e2842018-03-09 15:37:03 +0000523 "mock_transport.cc",
kjellander0f380d82016-06-01 04:48:26 -0700524 "mock_transport.h",
kjellander0f380d82016-06-01 04:48:26 -0700525 "null_transport.cc",
526 "null_transport.h",
527 "rtp_rtcp_observer.h",
528 "statistics.cc",
529 "statistics.h",
kjellander0f380d82016-06-01 04:48:26 -0700530 "win/run_loop_win.cc",
531 ]
532 if (!is_win) {
533 sources += [
534 "run_loop.cc",
535 "run_loop.h",
536 ]
537 }
538
kjellandere40a7ee2016-10-16 23:56:12 -0700539 if (!build_with_chromium && is_clang) {
540 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700541 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700542 }
543
544 deps = [
perkj488c5dc2017-02-08 05:55:51 -0800545 ":direct_transport",
Patrik Höglund7696bef2018-03-15 15:05:39 +0100546 ":fileutils",
kjellander0f380d82016-06-01 04:48:26 -0700547 ":rtp_test_utils",
548 ":test_support",
perkjc5726c12017-03-01 03:37:08 -0800549 ":video_test_common",
kjellander0f380d82016-06-01 04:48:26 -0700550 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100551 "../:typedefs",
Patrik Höglundbe214a22018-01-04 12:14:35 +0100552 "../api:libjingle_peerconnection_api",
mbonadei3edccb92017-06-01 04:47:20 -0700553 "../api:transport_api",
554 "../api:video_frame_api",
Patrik Höglundb5b5bce2017-11-13 10:19:58 +0100555 "../api:video_frame_api_i420",
mbonadei3edccb92017-06-01 04:47:20 -0700556 "../api/audio_codecs:builtin_audio_decoder_factory",
ossueb1fde42017-05-02 06:46:30 -0700557 "../api/audio_codecs:builtin_audio_encoder_factory",
ilnikd60d06a2017-04-05 03:02:20 -0700558 "../api/video_codecs:video_codecs_api",
kjellander94cee312016-06-10 01:56:57 -0700559 "../audio",
kjellander94cee312016-06-10 01:56:57 -0700560 "../call",
Mirko Bonadeia0e1a552017-12-04 10:50:51 +0100561 "../call:call_interfaces",
sprangdb2a9fc2017-08-09 06:42:32 -0700562 "../call:rtp_sender",
aleloi440b6d92017-08-22 05:43:23 -0700563 "../call:video_stream_api",
mbonadei3edccb92017-06-01 04:47:20 -0700564 "../common_video",
565 "../logging:rtc_event_log_api",
Qingsi Wang970b0882018-02-01 11:04:46 -0800566 "../logging:rtc_event_log_impl_base",
Emircan Uysaler03e6ec92018-03-09 15:03:26 -0800567 "../media:rtc_internal_video_codecs",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100568 "../media:rtc_media_base",
Artem Titov3faa8322018-03-07 14:44:00 +0100569 "../modules/audio_device",
Paulina Hensman7bd79a02018-03-15 12:44:12 +0100570 "../modules/audio_device:audio_device_impl",
mbonadei3edccb92017-06-01 04:47:20 -0700571 "../modules/audio_device:mock_audio_device",
aleloi10111bc2016-11-17 06:48:48 -0800572 "../modules/audio_mixer:audio_mixer_impl",
aleloidd310712016-11-17 06:28:59 -0800573 "../modules/audio_processing",
mbonadei3edccb92017-06-01 04:47:20 -0700574 "../modules/rtp_rtcp",
575 "../modules/rtp_rtcp:mock_rtp_rtcp",
Mirko Bonadeib5728d92017-12-06 07:51:33 +0100576 "../modules/rtp_rtcp:rtp_rtcp_format",
Patrik Höglund99175c62018-01-08 11:05:10 +0100577 "../modules/video_coding:video_codec_interface",
charujaincb728ea2017-09-18 03:08:08 -0700578 "../modules/video_coding:video_coding_utility",
mbonadei3edccb92017-06-01 04:47:20 -0700579 "../modules/video_coding:webrtc_h264",
Emircan Uysaler03e6ec92018-03-09 15:03:26 -0800580 "../modules/video_coding:webrtc_multiplex",
mbonadei3edccb92017-06-01 04:47:20 -0700581 "../modules/video_coding:webrtc_vp8",
582 "../modules/video_coding:webrtc_vp9",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100583 "../rtc_base:checks",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700584 "../rtc_base:rtc_base_approved",
585 "../rtc_base:rtc_task_queue",
586 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700587 "../system_wrappers",
Mirko Bonadeia498ae82017-12-06 09:17:14 +0100588 "../system_wrappers:field_trial_api",
Ilya Nikolaevskiy2ffe3e82018-01-17 19:57:24 +0000589 "../system_wrappers:runtime_enabled_features_api",
kjellander94cee312016-06-10 01:56:57 -0700590 "../video",
kjellander0f380d82016-06-01 04:48:26 -0700591 "//testing/gtest",
kjellander0f380d82016-06-01 04:48:26 -0700592 ]
mbonadei148d5a22017-04-28 05:24:50 -0700593 if (!is_android && !build_with_chromium) {
oprypin92220ff2017-03-23 03:40:03 -0700594 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
595 }
kjellander0f380d82016-06-01 04:48:26 -0700596}
597
598config("test_renderer_exported_config") {
599 if (is_win && is_clang) {
600 # GN orders flags on a target before flags from configs. The default config
601 # adds -Wall, and this flag have to be after -Wall -- so they need to
602 # come from a config and cannot be on the target directly.
ehmaldonado4bc4d272016-08-25 04:15:40 -0700603 cflags = [
kjellander0f380d82016-06-01 04:48:26 -0700604 "-Wno-bool-conversion",
605 "-Wno-comment",
606 "-Wno-delete-non-virtual-dtor",
607 ]
608 }
609}
610
ehmaldonado38a21322016-09-02 04:10:34 -0700611rtc_source_set("test_renderer") {
mbonadei9c296b32017-09-05 05:11:41 -0700612 public_deps = [
613 ":test_renderer_generic",
614 ]
kjellander0f380d82016-06-01 04:48:26 -0700615 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700616 if (is_mac) {
mbonadei9c296b32017-09-05 05:11:41 -0700617 public_deps += [ ":test_renderer_objc" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700618 }
619}
620
621if (is_mac) {
622 rtc_source_set("test_renderer_objc") {
623 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700624 visibility = [ ":test_renderer" ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700625 sources = [
626 "mac/video_renderer_mac.h",
627 "mac/video_renderer_mac.mm",
628 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700629 deps = [
mbonadei9c296b32017-09-05 05:11:41 -0700630 ":test_renderer_generic",
mbonadeicd95a4e2017-08-23 23:55:54 -0700631 "../rtc_base:rtc_base_approved",
632 ]
633 libs = [
634 "Cocoa.framework",
635 "OpenGL.framework",
636 "CoreVideo.framework",
637 ]
638 if (!build_with_chromium && is_clang) {
639 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
640 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
641 }
642 }
643}
644
645rtc_source_set("test_renderer_generic") {
646 testonly = true
mbonadei9c296b32017-09-05 05:11:41 -0700647 visibility = [
648 ":test_renderer",
649 ":test_renderer_objc",
650 ]
kjellander0f380d82016-06-01 04:48:26 -0700651 libs = []
652 sources = [
kjellander0f380d82016-06-01 04:48:26 -0700653 "video_renderer.cc",
654 "video_renderer.h",
655 "win/d3d_renderer.cc",
656 "win/d3d_renderer.h",
657 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700658 deps = [
659 ":test_support",
660 "..:webrtc_common",
Patrik Höglund3e113432017-12-15 14:40:10 +0100661 "../:typedefs",
Niels Möller9d138fc2018-02-15 16:58:43 +0100662 "../api:video_frame_api",
mbonadeicd95a4e2017-08-23 23:55:54 -0700663 "../common_video",
Mirko Bonadeiad627922017-11-30 17:16:21 +0100664 "../media:rtc_media_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100665 "../rtc_base:checks",
mbonadeicd95a4e2017-08-23 23:55:54 -0700666 "../rtc_base:rtc_base_approved",
667 "//testing/gtest",
668 ]
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100669 if (!(is_linux && rtc_use_x11) && !is_mac && !is_win) {
kjellander0f380d82016-06-01 04:48:26 -0700670 sources += [ "null_platform_renderer.cc" ]
671 }
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100672 if ((is_linux && rtc_use_x11) || is_mac) {
kjellander0f380d82016-06-01 04:48:26 -0700673 sources += [
674 "gl/gl_renderer.cc",
675 "gl/gl_renderer.h",
676 ]
677 }
678
Joachim Bauch75f18fc2017-12-20 21:25:47 +0100679 if (is_linux && rtc_use_x11) {
Edward Lemur84a87c42017-11-07 19:07:31 +0100680 sources += [
681 "linux/glx_renderer.cc",
682 "linux/glx_renderer.h",
683 "linux/video_renderer_linux.cc",
684 ]
kjellander0f380d82016-06-01 04:48:26 -0700685 libs += [
686 "Xext",
687 "X11",
688 "GL",
689 ]
690 }
691 if (is_android) {
692 libs += [
693 "GLESv2",
694 "log",
695 ]
696 }
kjellander0f380d82016-06-01 04:48:26 -0700697
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700698 public_configs = [ ":test_renderer_exported_config" ]
kjellander0f380d82016-06-01 04:48:26 -0700699
kjellandere40a7ee2016-10-16 23:56:12 -0700700 if (!build_with_chromium && is_clang) {
701 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700702 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700703 }
kjellander0f380d82016-06-01 04:48:26 -0700704}
kwiberg37e99fd2017-04-10 05:15:48 -0700705
706rtc_source_set("audio_codec_mocks") {
707 testonly = true
708 sources = [
kwiberg2b3aa142017-06-14 03:31:17 -0700709 "mock_audio_decoder.cc",
kwiberg37e99fd2017-04-10 05:15:48 -0700710 "mock_audio_decoder.h",
711 "mock_audio_decoder_factory.h",
ossueb1fde42017-05-02 06:46:30 -0700712 "mock_audio_encoder.cc",
713 "mock_audio_encoder.h",
714 "mock_audio_encoder_factory.h",
715 ]
716
717 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700718 ":test_support",
kwiberg529662a2017-09-04 05:43:17 -0700719 "../api:array_view",
ossueb1fde42017-05-02 06:46:30 -0700720 "../api/audio_codecs:audio_codecs_api",
mbonadei3edccb92017-06-01 04:47:20 -0700721 "../api/audio_codecs:builtin_audio_decoder_factory",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700722 "../rtc_base:rtc_base_approved",
kwiberg37e99fd2017-04-10 05:15:48 -0700723 ]
724}
sakald7fdb802017-05-26 01:51:53 -0700725
726if (!build_with_chromium && is_android) {
Mirko Bonadeifbb3b7d2017-11-07 15:36:33 +0000727 rtc_android_library("native_test_java") {
sakald7fdb802017-05-26 01:51:53 -0700728 testonly = true
729 java_files = [
730 "android/org/webrtc/native_test/RTCNativeUnitTest.java",
731 "android/org/webrtc/native_test/RTCNativeUnitTestActivity.java",
732 ]
733 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700734 "../rtc_base:base_java",
sakald7fdb802017-05-26 01:51:53 -0700735 "//testing/android/native_test:native_test_java",
sakald7fdb802017-05-26 01:51:53 -0700736 ]
737 }
738}