blob: e0601ecc5c59fba3714bb8b8225216c544f899f6 [file] [log] [blame]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +00001# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../webrtc.gni")
kjellander0f380d82016-06-01 04:48:26 -070010import("//build/config/ui.gni")
kjellander0f380d82016-06-01 04:48:26 -070011if (is_android) {
12 import("//build/config/android/rules.gni")
13}
ehmaldonadoed8c8ed2016-11-23 12:58:35 -080014if (rtc_use_memcheck) {
Henrik Kjellander90fd7d82017-05-09 08:30:10 +020015 import("//tools_webrtc/valgrind/valgrind-webrtc.gni")
ehmaldonadoed8c8ed2016-11-23 12:58:35 -080016}
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000017
kjellanderb62dbbe2016-09-23 00:38:52 -070018group("test") {
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000019 testonly = true
20
21 deps = [
22 ":field_trial",
kjellander0f380d82016-06-01 04:48:26 -070023 ":rtp_test_utils",
24 ":test_common",
25 ":test_renderer",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000026 ":test_support",
kjellander0f380d82016-06-01 04:48:26 -070027 ":video_test_common",
28 ]
mbonadei148d5a22017-04-28 05:24:50 -070029
30 if (!build_with_chromium) {
31 deps += [
32 ":test_main",
33 ":test_support_unittests",
34 ]
35 }
kjellander0f380d82016-06-01 04:48:26 -070036}
37
ehmaldonado38a21322016-09-02 04:10:34 -070038rtc_source_set("video_test_common") {
kjellander0f380d82016-06-01 04:48:26 -070039 testonly = true
40 sources = [
41 "fake_texture_frame.cc",
42 "fake_texture_frame.h",
43 "frame_generator.cc",
44 "frame_generator.h",
ehmaldonado656610f2017-02-06 02:21:11 -080045 "frame_generator_capturer.cc",
46 "frame_generator_capturer.h",
kjellander0f380d82016-06-01 04:48:26 -070047 "frame_utils.cc",
48 "frame_utils.h",
ehmaldonado656610f2017-02-06 02:21:11 -080049 "vcm_capturer.cc",
50 "vcm_capturer.h",
sprangc5d62e22017-04-02 23:53:04 -070051 "video_capturer.cc",
ehmaldonado656610f2017-02-06 02:21:11 -080052 "video_capturer.h",
mflodman351424e2017-08-10 02:43:14 -070053 "video_codec_settings.h",
kjellander0f380d82016-06-01 04:48:26 -070054 ]
55
kjellandere40a7ee2016-10-16 23:56:12 -070056 if (!build_with_chromium && is_clang) {
57 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070058 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -070059 }
60
61 deps = [
mbonadei3edccb92017-06-01 04:47:20 -070062 "..:webrtc_common",
mflodman351424e2017-08-10 02:43:14 -070063 "../api/video_codecs:video_codecs_api",
aleloi440b6d92017-08-22 05:43:23 -070064 "../call:video_stream_api",
kjellander0f380d82016-06-01 04:48:26 -070065 "../common_video",
sprangc5d62e22017-04-02 23:53:04 -070066 "../media:rtc_media_base",
ehmaldonado656610f2017-02-06 02:21:11 -080067 "../modules/video_capture:video_capture_module",
ehmaldonadof6a861a2017-07-19 10:40:47 -070068 "../rtc_base:rtc_base_approved",
69 "../rtc_base:rtc_task_queue",
mbonadei3edccb92017-06-01 04:47:20 -070070 "../system_wrappers",
kjellander0f380d82016-06-01 04:48:26 -070071 ]
72}
73
ehmaldonado38a21322016-09-02 04:10:34 -070074rtc_source_set("rtp_test_utils") {
kjellander0f380d82016-06-01 04:48:26 -070075 testonly = true
76 sources = [
77 "rtcp_packet_parser.cc",
78 "rtcp_packet_parser.h",
79 "rtp_file_reader.cc",
80 "rtp_file_reader.h",
81 "rtp_file_writer.cc",
82 "rtp_file_writer.h",
83 ]
84
kjellandere40a7ee2016-10-16 23:56:12 -070085 if (!build_with_chromium && is_clang) {
86 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070087 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -070088 }
89
90 deps = [
91 "..:webrtc_common",
92 "../modules/rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -070093 "../rtc_base:rtc_base_approved",
kjellander0f380d82016-06-01 04:48:26 -070094 "//testing/gtest",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000095 ]
96}
97
ehmaldonado38a21322016-09-02 04:10:34 -070098rtc_source_set("field_trial") {
kjellander0f380d82016-06-01 04:48:26 -070099 testonly = true
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000100 sources = [
101 "field_trial.cc",
102 "field_trial.h",
103 ]
104
105 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000106 "..:webrtc_common",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000107 "../system_wrappers",
phoglund37ebcf02016-01-08 05:04:57 -0800108 "../system_wrappers:field_trial_default",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000109 ]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000110}
111
mbonadeicd95a4e2017-08-23 23:55:54 -0700112if (is_ios) {
113 rtc_source_set("test_support_objc") {
114 testonly = true
115 visibility = [ ":*" ]
116 sources = [
117 "ios/test_support.h",
118 "ios/test_support.mm",
119 ]
120 }
121}
122
mbonadei148d5a22017-04-28 05:24:50 -0700123rtc_source_set("test_support") {
124 testonly = true
kjellander32c4a202016-08-30 02:53:49 -0700125
mbonadei148d5a22017-04-28 05:24:50 -0700126 sources = [
127 "gmock.h",
128 "gtest.h",
129 "testsupport/packet_reader.cc",
130 "testsupport/packet_reader.h",
131 "testsupport/perf_test.cc",
132 "testsupport/perf_test.h",
133 "testsupport/trace_to_stderr.cc",
134 "testsupport/trace_to_stderr.h",
135 "testsupport/unittest_utils.h",
136 ]
137
mbonadeicd95a4e2017-08-23 23:55:54 -0700138 public_deps = [
139 ":fileutils",
140 ]
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200141 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700142 public_deps += [ ":test_support_objc" ]
Kári Tristan Helgasone2baffb2017-06-09 10:31:58 +0200143 }
144
mbonadei148d5a22017-04-28 05:24:50 -0700145 deps = [
146 "..:webrtc_common",
mbonadei148d5a22017-04-28 05:24:50 -0700147 "../common_video",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700148 "../rtc_base:gtest_prod",
149 "../rtc_base:rtc_base_approved",
mbonadei148d5a22017-04-28 05:24:50 -0700150 "../system_wrappers",
151 "//testing/gmock",
152 "//testing/gtest",
153 ]
154
mbonadei148d5a22017-04-28 05:24:50 -0700155 if (!build_with_chromium && is_clang) {
156 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
157 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
158 }
159
160 if (is_android) {
161 deps += [ "//base:base" ]
162 }
163
164 if (is_ios && !build_with_chromium) {
kthelgason36d658d2017-08-24 05:43:45 -0700165 deps += [ "../sdk:common_objc" ]
mbonadei148d5a22017-04-28 05:24:50 -0700166 }
167
168 if (rtc_use_memcheck) {
169 data = valgrind_webrtc_dependencies
kjellander32c4a202016-08-30 02:53:49 -0700170 }
171}
172
mbonadei9452c622017-04-27 12:29:29 -0700173if (!build_with_chromium) {
174 # This target depends on //third_party/gflags and since chromium does not
175 # have gflags it causes an error when Gn parses this BUILD.gn file.
176 # It seems that Gn eagerly tries to understand if all the targets are
177 # buildable (even deps). Obviously gflags is not buildable in chromium
178 # so if a target depends on this BUILD.gn file we hit this error.
179 rtc_source_set("test_main") {
180 testonly = true
181 sources = [
182 "test_main.cc",
183 ]
kjellander0f380d82016-06-01 04:48:26 -0700184
mbonadei9452c622017-04-27 12:29:29 -0700185 public_deps = [
186 ":test_support",
187 ]
188 deps = [
189 ":field_trial",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700190 "../rtc_base:rtc_base_approved",
mbonadei9452c622017-04-27 12:29:29 -0700191 "../system_wrappers:metrics_default",
192 "//testing/gmock",
193 "//testing/gtest",
194 "//third_party/gflags",
195 ]
kjellander0f380d82016-06-01 04:48:26 -0700196 }
197
mbonadei9452c622017-04-27 12:29:29 -0700198 rtc_source_set("video_test_support") {
199 testonly = true
200
201 sources = [
202 "testsupport/frame_reader.h",
203 "testsupport/frame_writer.h",
204 "testsupport/metrics/video_metrics.cc",
205 "testsupport/metrics/video_metrics.h",
206 "testsupport/mock/mock_frame_reader.h",
207 "testsupport/mock/mock_frame_writer.h",
208 "testsupport/y4m_frame_writer.cc",
209 "testsupport/yuv_frame_reader.cc",
210 "testsupport/yuv_frame_writer.cc",
211 ]
212
213 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700214 ":test_support",
215 ":video_test_common",
216 "..:webrtc_common",
ilnikee42d192017-08-22 07:16:20 -0700217 "../api:video_frame_api",
mbonadei9452c622017-04-27 12:29:29 -0700218 "../common_video",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700219 "../rtc_base:rtc_base_approved",
mbonadei9452c622017-04-27 12:29:29 -0700220 "../system_wrappers",
221 "//testing/gmock",
222 "//testing/gtest",
223 "//third_party/gflags",
224 ]
225
ilnikee42d192017-08-22 07:16:20 -0700226 if (!is_ios) {
227 deps += [ "//third_party:jpeg" ]
228 sources += [ "testsupport/jpeg_frame_writer.cc" ]
229 }
230
mbonadei9452c622017-04-27 12:29:29 -0700231 public_deps = [
232 ":fileutils",
233 ]
234
235 if (!build_with_chromium && is_clang) {
236 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
237 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
238 }
239
240 if (is_android) {
241 deps += [ "//base:base" ]
242 }
243
244 if (is_ios) {
kthelgason36d658d2017-08-24 05:43:45 -0700245 deps += [ "../sdk:common_objc" ]
mbonadei9452c622017-04-27 12:29:29 -0700246 }
247
248 if (rtc_use_memcheck) {
249 data = valgrind_webrtc_dependencies
250 }
kjellander0f380d82016-06-01 04:48:26 -0700251 }
252
ilnike264a9e2017-07-25 07:31:18 -0700253 rtc_source_set("test_support_test_output") {
mbonadei9452c622017-04-27 12:29:29 -0700254 testonly = true
mbonadei9452c622017-04-27 12:29:29 -0700255 sources = [
ilnike264a9e2017-07-25 07:31:18 -0700256 "testsupport/test_output.cc",
257 "testsupport/test_output.h",
mbonadei9452c622017-04-27 12:29:29 -0700258 ]
mbonadei9452c622017-04-27 12:29:29 -0700259 deps = [
mbonadei148d5a22017-04-28 05:24:50 -0700260 ":fileutils",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700261 "../rtc_base:rtc_base_approved",
mbonadei9452c622017-04-27 12:29:29 -0700262 "//third_party/gflags",
263 ]
mbonadei148d5a22017-04-28 05:24:50 -0700264 }
mbonadei9452c622017-04-27 12:29:29 -0700265
mbonadei148d5a22017-04-28 05:24:50 -0700266 test_support_unittests_resources = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700267 "../../resources/foreman_cif_short.yuv",
268 "../../resources/video_coding/frame-ethernet-ii.pcap",
269 "../../resources/video_coding/frame-loopback.pcap",
270 "../../resources/video_coding/pltype103.rtp",
271 "../../resources/video_coding/pltype103_header_only.rtp",
272 "../../resources/video_coding/ssrcs-2.pcap",
273 "../../resources/video_coding/ssrcs-3.pcap",
mbonadei148d5a22017-04-28 05:24:50 -0700274 ]
mbonadei9452c622017-04-27 12:29:29 -0700275
mbonadei148d5a22017-04-28 05:24:50 -0700276 if (is_ios) {
277 bundle_data("test_support_unittests_bundle_data") {
278 testonly = true
279 sources = test_support_unittests_resources
280 outputs = [
281 "{{bundle_resources_dir}}/{{source_file_part}}",
282 ]
mbonadei9452c622017-04-27 12:29:29 -0700283 }
kjellander28a0ffd2016-08-24 07:48:42 -0700284 }
kjellander0f380d82016-06-01 04:48:26 -0700285
mbonadei9452c622017-04-27 12:29:29 -0700286 rtc_test("test_support_unittests") {
mbonadei3edccb92017-06-01 04:47:20 -0700287 deps = [
288 ":fake_audio_device",
289 ":rtp_test_utils",
290 "../api:video_frame_api",
mbonadei3edccb92017-06-01 04:47:20 -0700291 "../call:call_interfaces",
292 "../common_audio",
293 "../modules/rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700294 "../rtc_base:rtc_base_approved",
mbonadei3edccb92017-06-01 04:47:20 -0700295 "../system_wrappers",
296 ]
mbonadei9452c622017-04-27 12:29:29 -0700297 sources = [
298 "fake_audio_device_unittest.cc",
299 "fake_network_pipe_unittest.cc",
300 "frame_generator_unittest.cc",
301 "rtp_file_reader_unittest.cc",
302 "rtp_file_writer_unittest.cc",
eladalon413ee9a2017-08-22 04:02:52 -0700303 "single_threaded_task_queue_unittest.cc",
mbonadei9452c622017-04-27 12:29:29 -0700304 "testsupport/always_passing_unittest.cc",
mbonadei9452c622017-04-27 12:29:29 -0700305 "testsupport/metrics/video_metrics_unittest.cc",
306 "testsupport/packet_reader_unittest.cc",
307 "testsupport/perf_test_unittest.cc",
ilnike264a9e2017-07-25 07:31:18 -0700308 "testsupport/test_output_unittest.cc",
mbonadei9452c622017-04-27 12:29:29 -0700309 "testsupport/y4m_frame_writer_unittest.cc",
310 "testsupport/yuv_frame_reader_unittest.cc",
311 "testsupport/yuv_frame_writer_unittest.cc",
312 ]
kjellander28a0ffd2016-08-24 07:48:42 -0700313
mbonadei9452c622017-04-27 12:29:29 -0700314 # TODO(jschuh): Bug 1348: fix this warning.
315 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
316
317 if (is_win) {
318 # virtual override w/different const/volatile signature.
319 cflags = [ "/wd4373" ]
320 }
321
322 if (!build_with_chromium && is_clang) {
323 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
324 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
325 }
326
327 data = test_support_unittests_resources
328 if (is_android) {
329 deps += [ "//testing/android/native_test:native_test_support" ]
330 shard_timeout = 900
331 }
332
333 if (is_ios) {
334 deps += [ ":test_support_unittests_bundle_data" ]
335 }
336
337 deps += [
338 ":direct_transport",
339 ":fileutils_unittests",
340 ":test_common",
341 ":test_main",
ilnike264a9e2017-07-25 07:31:18 -0700342 ":test_support_test_output",
mbonadei9452c622017-04-27 12:29:29 -0700343 ":video_test_common",
344 ":video_test_support",
345 "../modules/video_capture",
346 "//testing/gmock",
347 "//testing/gtest",
348 "//third_party/gflags",
349 ]
350 }
kjellander0f380d82016-06-01 04:48:26 -0700351}
mbonadei9452c622017-04-27 12:29:29 -0700352
mbonadeicd95a4e2017-08-23 23:55:54 -0700353if (is_ios) {
354 rtc_source_set("fileutils_objc") {
355 visibility = [ ":*" ]
356 sources = [
357 "testsupport/iosfileutils.mm",
358 ]
359 deps = [
360 "..:webrtc_common",
361 "../rtc_base:rtc_base_approved",
kthelgason36d658d2017-08-24 05:43:45 -0700362 "../sdk:common_objc",
mbonadeicd95a4e2017-08-23 23:55:54 -0700363 ]
364 }
365}
366
mbonadei9452c622017-04-27 12:29:29 -0700367rtc_source_set("fileutils") {
368 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700369 visibility = [ ":*" ]
mbonadei9452c622017-04-27 12:29:29 -0700370 sources = [
371 "testsupport/fileutils.cc",
372 "testsupport/fileutils.h",
373 ]
mbonadei3edccb92017-06-01 04:47:20 -0700374 deps = [
375 "..:webrtc_common",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700376 "../rtc_base:rtc_base_approved",
mbonadei3edccb92017-06-01 04:47:20 -0700377 ]
mbonadei9452c622017-04-27 12:29:29 -0700378 if (is_ios) {
mbonadeicd95a4e2017-08-23 23:55:54 -0700379 deps += [ ":fileutils_objc" ]
mbonadei3edccb92017-06-01 04:47:20 -0700380 }
381 if (is_win) {
ehmaldonadof6a861a2017-07-19 10:40:47 -0700382 deps += [ "../rtc_base:rtc_base" ]
mbonadei9452c622017-04-27 12:29:29 -0700383 }
mbonadei9452c622017-04-27 12:29:29 -0700384}
385
386rtc_source_set("run_test") {
387 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700388 if (is_mac) {
389 public_deps = [
390 ":run_test_objc",
391 ]
392 } else {
393 public_deps = [
394 ":run_test_generic",
395 ]
396 }
397}
398
399rtc_source_set("run_test_interface") {
400 testonly = true
401 visibility = [ ":*" ]
mbonadei9452c622017-04-27 12:29:29 -0700402 sources = [
403 "run_test.h",
404 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700405}
406
407if (is_mac) {
408 rtc_source_set("run_test_objc") {
409 testonly = true
410 visibility = [ ":*" ]
411 sources = [
412 "mac/run_test.mm",
413 ]
414 public_deps = [
415 ":run_test_interface",
416 ]
mbonadei9452c622017-04-27 12:29:29 -0700417 }
418}
419
mbonadeicd95a4e2017-08-23 23:55:54 -0700420rtc_source_set("run_test_generic") {
421 testonly = true
422 visibility = [ ":*" ]
423 sources = [
424 "run_test.cc",
425 ]
426 public_deps = [
427 ":run_test_interface",
428 ]
429}
430
ehmaldonado37535bf2016-12-05 06:42:45 -0800431rtc_source_set("fileutils_unittests") {
432 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700433 visibility = [ ":*" ] # Only targets in this file can depend on this.
ehmaldonado37535bf2016-12-05 06:42:45 -0800434 sources = [
435 "testsupport/fileutils_unittest.cc",
436 ]
437 deps = [
438 ":fileutils",
mbonadei3edccb92017-06-01 04:47:20 -0700439 ":test_support",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700440 "../rtc_base:rtc_base_approved",
ehmaldonado37535bf2016-12-05 06:42:45 -0800441 "//testing/gmock",
442 "//testing/gtest",
443 ]
444}
kjellander0f380d82016-06-01 04:48:26 -0700445
perkj488c5dc2017-02-08 05:55:51 -0800446rtc_source_set("direct_transport") {
447 testonly = true
448 sources = [
449 "direct_transport.cc",
450 "direct_transport.h",
451 "fake_network_pipe.cc",
452 "fake_network_pipe.h",
453 ]
454 if (!build_with_chromium && is_clang) {
455 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
456 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
457 }
458 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700459 "..:webrtc_common",
perkj488c5dc2017-02-08 05:55:51 -0800460 "../api:transport_api",
perkj488c5dc2017-02-08 05:55:51 -0800461 "../call",
mbonadei3edccb92017-06-01 04:47:20 -0700462 "../modules/rtp_rtcp",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700463 "../rtc_base:rtc_base_approved",
eladalon413ee9a2017-08-22 04:02:52 -0700464 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700465 "../system_wrappers",
perkj488c5dc2017-02-08 05:55:51 -0800466 ]
eladalon413ee9a2017-08-22 04:02:52 -0700467 public_deps = [
468 ":single_threaded_task_queue",
469 ]
470}
471
472rtc_source_set("single_threaded_task_queue") {
473 testonly = true
474 sources = [
475 "single_threaded_task_queue.cc",
476 "single_threaded_task_queue.h",
477 ]
478 deps = [
479 "../rtc_base:rtc_base_approved",
480 ]
perkj488c5dc2017-02-08 05:55:51 -0800481}
482
perkj16ccfdf2017-02-28 14:41:05 -0800483rtc_source_set("fake_audio_device") {
484 testonly = true
485 sources = [
486 "fake_audio_device.cc",
487 "fake_audio_device.h",
488 ]
489 if (!build_with_chromium && is_clang) {
490 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
491 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
492 }
493 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700494 "..:webrtc_common",
mbonadei3edccb92017-06-01 04:47:20 -0700495 "../common_audio:common_audio",
mbonadeib80ef8c2017-04-24 13:05:47 -0700496 "../modules/audio_device:audio_device",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700497 "../rtc_base:rtc_base_approved",
mbonadei3edccb92017-06-01 04:47:20 -0700498 "../system_wrappers:system_wrappers",
perkj16ccfdf2017-02-28 14:41:05 -0800499 ]
500}
501
ehmaldonado38a21322016-09-02 04:10:34 -0700502rtc_source_set("test_common") {
kjellander0f380d82016-06-01 04:48:26 -0700503 testonly = true
504 sources = [
505 "call_test.cc",
506 "call_test.h",
507 "configurable_frame_size_encoder.cc",
508 "configurable_frame_size_encoder.h",
509 "constants.cc",
510 "constants.h",
kjellander0f380d82016-06-01 04:48:26 -0700511 "drifting_clock.cc",
512 "drifting_clock.h",
513 "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",
kjellander0f380d82016-06-01 04:48:26 -0700520 "layer_filtering_transport.cc",
521 "layer_filtering_transport.h",
522 "mock_transport.h",
523 "mock_voe_channel_proxy.h",
524 "mock_voice_engine.h",
525 "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",
perkj16ccfdf2017-02-28 14:41:05 -0800546 ":fake_audio_device",
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",
mbonadei3edccb92017-06-01 04:47:20 -0700551 "../api:transport_api",
552 "../api:video_frame_api",
553 "../api/audio_codecs:builtin_audio_decoder_factory",
ossueb1fde42017-05-02 06:46:30 -0700554 "../api/audio_codecs:builtin_audio_encoder_factory",
ilnikd60d06a2017-04-05 03:02:20 -0700555 "../api/video_codecs:video_codecs_api",
kjellander94cee312016-06-10 01:56:57 -0700556 "../audio",
kjellander94cee312016-06-10 01:56:57 -0700557 "../call",
sprangdb2a9fc2017-08-09 06:42:32 -0700558 "../call:rtp_sender",
aleloi440b6d92017-08-22 05:43:23 -0700559 "../call:video_stream_api",
mbonadei3edccb92017-06-01 04:47:20 -0700560 "../common_video",
561 "../logging:rtc_event_log_api",
562 "../modules/audio_device:mock_audio_device",
aleloi10111bc2016-11-17 06:48:48 -0800563 "../modules/audio_mixer:audio_mixer_impl",
aleloidd310712016-11-17 06:28:59 -0800564 "../modules/audio_processing",
mbonadei3edccb92017-06-01 04:47:20 -0700565 "../modules/rtp_rtcp",
566 "../modules/rtp_rtcp:mock_rtp_rtcp",
567 "../modules/video_coding:webrtc_h264",
568 "../modules/video_coding:webrtc_vp8",
569 "../modules/video_coding:webrtc_vp9",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700570 "../rtc_base:rtc_base_approved",
571 "../rtc_base:rtc_task_queue",
572 "../rtc_base:sequenced_task_checker",
mbonadei3edccb92017-06-01 04:47:20 -0700573 "../system_wrappers",
kjellander94cee312016-06-10 01:56:57 -0700574 "../video",
mbonadei3edccb92017-06-01 04:47:20 -0700575 "../voice_engine",
kjellander0f380d82016-06-01 04:48:26 -0700576 "//testing/gmock",
577 "//testing/gtest",
kjellander0f380d82016-06-01 04:48:26 -0700578 ]
mbonadei148d5a22017-04-28 05:24:50 -0700579 if (!is_android && !build_with_chromium) {
oprypin92220ff2017-03-23 03:40:03 -0700580 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
581 }
kjellander0f380d82016-06-01 04:48:26 -0700582}
583
584config("test_renderer_exported_config") {
585 if (is_win && is_clang) {
586 # GN orders flags on a target before flags from configs. The default config
587 # adds -Wall, and this flag have to be after -Wall -- so they need to
588 # come from a config and cannot be on the target directly.
ehmaldonado4bc4d272016-08-25 04:15:40 -0700589 cflags = [
kjellander0f380d82016-06-01 04:48:26 -0700590 "-Wno-bool-conversion",
591 "-Wno-comment",
592 "-Wno-delete-non-virtual-dtor",
593 ]
594 }
595}
596
ehmaldonado38a21322016-09-02 04:10:34 -0700597rtc_source_set("test_renderer") {
kjellander0f380d82016-06-01 04:48:26 -0700598 testonly = true
mbonadeicd95a4e2017-08-23 23:55:54 -0700599 if (is_mac) {
600 public_deps = [
601 ":test_renderer_objc",
602 ]
603 } else {
604 public_deps = [
605 ":test_renderer_generic",
606 ]
607 }
608}
609
610if (is_mac) {
611 rtc_source_set("test_renderer_objc") {
612 testonly = true
613 visibility = [ ":*" ]
614 sources = [
615 "mac/video_renderer_mac.h",
616 "mac/video_renderer_mac.mm",
617 ]
618 public_deps = [
619 ":test_renderer_generic",
620 ]
621 deps = [
622 "../rtc_base:rtc_base_approved",
623 ]
624 libs = [
625 "Cocoa.framework",
626 "OpenGL.framework",
627 "CoreVideo.framework",
628 ]
629 if (!build_with_chromium && is_clang) {
630 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
631 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
632 }
633 }
634}
635
636rtc_source_set("test_renderer_generic") {
637 testonly = true
638 visibility = [ ":*" ]
kjellander0f380d82016-06-01 04:48:26 -0700639 libs = []
640 sources = [
641 "linux/glx_renderer.cc",
642 "linux/glx_renderer.h",
643 "linux/video_renderer_linux.cc",
kjellander0f380d82016-06-01 04:48:26 -0700644 "video_renderer.cc",
645 "video_renderer.h",
646 "win/d3d_renderer.cc",
647 "win/d3d_renderer.h",
648 ]
mbonadeicd95a4e2017-08-23 23:55:54 -0700649 deps = [
650 ":test_support",
651 "..:webrtc_common",
652 "../common_video",
653 "../modules/media_file",
654 "../rtc_base:rtc_base_approved",
655 "//testing/gtest",
656 ]
kjellander0f380d82016-06-01 04:48:26 -0700657 if (!is_linux && !is_mac && !is_win) {
658 sources += [ "null_platform_renderer.cc" ]
659 }
660 if (is_linux || is_mac) {
661 sources += [
662 "gl/gl_renderer.cc",
663 "gl/gl_renderer.h",
664 ]
665 }
666
667 if (is_linux) {
668 libs += [
669 "Xext",
670 "X11",
671 "GL",
672 ]
673 }
674 if (is_android) {
675 libs += [
676 "GLESv2",
677 "log",
678 ]
679 }
kjellander0f380d82016-06-01 04:48:26 -0700680
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700681 public_configs = [ ":test_renderer_exported_config" ]
kjellander0f380d82016-06-01 04:48:26 -0700682
kjellandere40a7ee2016-10-16 23:56:12 -0700683 if (!build_with_chromium && is_clang) {
684 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700685 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700686 }
kjellander0f380d82016-06-01 04:48:26 -0700687}
kwiberg37e99fd2017-04-10 05:15:48 -0700688
689rtc_source_set("audio_codec_mocks") {
690 testonly = true
691 sources = [
kwiberg2b3aa142017-06-14 03:31:17 -0700692 "mock_audio_decoder.cc",
kwiberg37e99fd2017-04-10 05:15:48 -0700693 "mock_audio_decoder.h",
694 "mock_audio_decoder_factory.h",
ossueb1fde42017-05-02 06:46:30 -0700695 "mock_audio_encoder.cc",
696 "mock_audio_encoder.h",
697 "mock_audio_encoder_factory.h",
698 ]
699
700 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700701 ":test_support",
ossueb1fde42017-05-02 06:46:30 -0700702 "../api/audio_codecs:audio_codecs_api",
mbonadei3edccb92017-06-01 04:47:20 -0700703 "../api/audio_codecs:builtin_audio_decoder_factory",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700704 "../rtc_base:rtc_base_approved",
ossueb1fde42017-05-02 06:46:30 -0700705 "//testing/gmock",
kwiberg37e99fd2017-04-10 05:15:48 -0700706 ]
707}
sakald7fdb802017-05-26 01:51:53 -0700708
709if (!build_with_chromium && is_android) {
710 android_library("native_test_java") {
711 testonly = true
712 java_files = [
713 "android/org/webrtc/native_test/RTCNativeUnitTest.java",
714 "android/org/webrtc/native_test/RTCNativeUnitTestActivity.java",
715 ]
716 deps = [
jianjun.zhuc0247402017-07-11 06:20:45 -0700717 "../rtc_base:base_java",
sakald7fdb802017-05-26 01:51:53 -0700718 "//testing/android/native_test:native_test_java",
sakald7fdb802017-05-26 01:51:53 -0700719 ]
720 }
721}