blob: 0d234cd6e3eb24d9d779b74219dd916363ad9200 [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",
kjellander0f380d82016-06-01 04:48:26 -070053 ]
54
kjellandere40a7ee2016-10-16 23:56:12 -070055 if (!build_with_chromium && is_clang) {
56 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070057 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -070058 }
59
60 deps = [
mbonadei3edccb92017-06-01 04:47:20 -070061 "..:video_stream_api",
62 "..:webrtc_common",
63 "../base:rtc_base_approved",
64 "../base:rtc_task_queue",
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",
mbonadei3edccb92017-06-01 04:47:20 -070068 "../system_wrappers",
kjellander0f380d82016-06-01 04:48:26 -070069 ]
70}
71
ehmaldonado38a21322016-09-02 04:10:34 -070072rtc_source_set("rtp_test_utils") {
kjellander0f380d82016-06-01 04:48:26 -070073 testonly = true
74 sources = [
75 "rtcp_packet_parser.cc",
76 "rtcp_packet_parser.h",
77 "rtp_file_reader.cc",
78 "rtp_file_reader.h",
79 "rtp_file_writer.cc",
80 "rtp_file_writer.h",
81 ]
82
kjellandere40a7ee2016-10-16 23:56:12 -070083 if (!build_with_chromium && is_clang) {
84 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -070085 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -070086 }
87
88 deps = [
89 "..:webrtc_common",
mbonadei3edccb92017-06-01 04:47:20 -070090 "../base:rtc_base_approved",
kjellander0f380d82016-06-01 04:48:26 -070091 "../modules/rtp_rtcp",
92 "//testing/gtest",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000093 ]
94}
95
ehmaldonado38a21322016-09-02 04:10:34 -070096rtc_source_set("field_trial") {
kjellander0f380d82016-06-01 04:48:26 -070097 testonly = true
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +000098 sources = [
99 "field_trial.cc",
100 "field_trial.h",
101 ]
102
103 deps = [
kwiberg@webrtc.orgac2d27d2015-02-26 13:59:22 +0000104 "..:webrtc_common",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000105 "../system_wrappers",
phoglund37ebcf02016-01-08 05:04:57 -0800106 "../system_wrappers:field_trial_default",
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000107 ]
kjellander@webrtc.orgb8caf6a2014-09-30 18:05:02 +0000108}
109
mbonadei148d5a22017-04-28 05:24:50 -0700110rtc_source_set("test_support") {
111 testonly = true
kjellander32c4a202016-08-30 02:53:49 -0700112
mbonadei148d5a22017-04-28 05:24:50 -0700113 sources = [
114 "gmock.h",
115 "gtest.h",
116 "testsupport/packet_reader.cc",
117 "testsupport/packet_reader.h",
118 "testsupport/perf_test.cc",
119 "testsupport/perf_test.h",
120 "testsupport/trace_to_stderr.cc",
121 "testsupport/trace_to_stderr.h",
122 "testsupport/unittest_utils.h",
123 ]
124
125 deps = [
126 "..:webrtc_common",
127 "../base:gtest_prod",
128 "../base:rtc_base_approved",
129 "../common_video",
130 "../system_wrappers",
131 "//testing/gmock",
132 "//testing/gtest",
133 ]
134
135 public_deps = [
136 ":fileutils",
137 ]
138
139 if (!build_with_chromium && is_clang) {
140 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
141 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
142 }
143
144 if (is_android) {
145 deps += [ "//base:base" ]
146 }
147
148 if (is_ios && !build_with_chromium) {
mbonadei2c8ac1b2017-05-31 05:14:26 -0700149 deps += [ "../sdk:objc_common" ]
mbonadei148d5a22017-04-28 05:24:50 -0700150 }
151
152 if (rtc_use_memcheck) {
153 data = valgrind_webrtc_dependencies
kjellander32c4a202016-08-30 02:53:49 -0700154 }
155}
156
mbonadei9452c622017-04-27 12:29:29 -0700157if (!build_with_chromium) {
158 # This target depends on //third_party/gflags and since chromium does not
159 # have gflags it causes an error when Gn parses this BUILD.gn file.
160 # It seems that Gn eagerly tries to understand if all the targets are
161 # buildable (even deps). Obviously gflags is not buildable in chromium
162 # so if a target depends on this BUILD.gn file we hit this error.
163 rtc_source_set("test_main") {
164 testonly = true
165 sources = [
166 "test_main.cc",
167 ]
kjellander0f380d82016-06-01 04:48:26 -0700168
mbonadei9452c622017-04-27 12:29:29 -0700169 public_deps = [
170 ":test_support",
171 ]
172 deps = [
173 ":field_trial",
mbonadei3edccb92017-06-01 04:47:20 -0700174 "../base:rtc_base_approved",
mbonadei9452c622017-04-27 12:29:29 -0700175 "../system_wrappers:metrics_default",
176 "//testing/gmock",
177 "//testing/gtest",
178 "//third_party/gflags",
179 ]
kjellander0f380d82016-06-01 04:48:26 -0700180 }
181
mbonadei9452c622017-04-27 12:29:29 -0700182 rtc_source_set("video_test_support") {
183 testonly = true
184
185 sources = [
186 "testsupport/frame_reader.h",
187 "testsupport/frame_writer.h",
188 "testsupport/metrics/video_metrics.cc",
189 "testsupport/metrics/video_metrics.h",
190 "testsupport/mock/mock_frame_reader.h",
191 "testsupport/mock/mock_frame_writer.h",
192 "testsupport/y4m_frame_writer.cc",
193 "testsupport/yuv_frame_reader.cc",
194 "testsupport/yuv_frame_writer.cc",
195 ]
196
197 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700198 ":test_support",
199 ":video_test_common",
200 "..:webrtc_common",
mbonadei9452c622017-04-27 12:29:29 -0700201 "../base:rtc_base_approved",
202 "../common_video",
203 "../system_wrappers",
204 "//testing/gmock",
205 "//testing/gtest",
206 "//third_party/gflags",
207 ]
208
209 public_deps = [
210 ":fileutils",
211 ]
212
213 if (!build_with_chromium && is_clang) {
214 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
215 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
216 }
217
218 if (is_android) {
219 deps += [ "//base:base" ]
220 }
221
222 if (is_ios) {
mbonadei2c8ac1b2017-05-31 05:14:26 -0700223 deps += [ "../sdk:objc_common" ]
mbonadei9452c622017-04-27 12:29:29 -0700224 }
225
226 if (rtc_use_memcheck) {
227 data = valgrind_webrtc_dependencies
228 }
kjellander0f380d82016-06-01 04:48:26 -0700229 }
230
mbonadei148d5a22017-04-28 05:24:50 -0700231 rtc_source_set("test_support_isolated_output") {
mbonadei9452c622017-04-27 12:29:29 -0700232 testonly = true
mbonadei9452c622017-04-27 12:29:29 -0700233 sources = [
mbonadei9452c622017-04-27 12:29:29 -0700234 "testsupport/isolated_output.cc",
235 "testsupport/isolated_output.h",
mbonadei9452c622017-04-27 12:29:29 -0700236 ]
mbonadei9452c622017-04-27 12:29:29 -0700237 deps = [
mbonadei148d5a22017-04-28 05:24:50 -0700238 ":fileutils",
mbonadei9452c622017-04-27 12:29:29 -0700239 "../base:rtc_base_approved",
mbonadei9452c622017-04-27 12:29:29 -0700240 "//third_party/gflags",
241 ]
mbonadei148d5a22017-04-28 05:24:50 -0700242 }
mbonadei9452c622017-04-27 12:29:29 -0700243
mbonadei148d5a22017-04-28 05:24:50 -0700244 test_support_unittests_resources = [
245 "//resources/foreman_cif_short.yuv",
246 "//resources/video_coding/frame-ethernet-ii.pcap",
247 "//resources/video_coding/frame-loopback.pcap",
248 "//resources/video_coding/pltype103.rtp",
249 "//resources/video_coding/pltype103_header_only.rtp",
250 "//resources/video_coding/ssrcs-2.pcap",
251 "//resources/video_coding/ssrcs-3.pcap",
252 ]
mbonadei9452c622017-04-27 12:29:29 -0700253
mbonadei148d5a22017-04-28 05:24:50 -0700254 if (is_ios) {
255 bundle_data("test_support_unittests_bundle_data") {
256 testonly = true
257 sources = test_support_unittests_resources
258 outputs = [
259 "{{bundle_resources_dir}}/{{source_file_part}}",
260 ]
mbonadei9452c622017-04-27 12:29:29 -0700261 }
kjellander28a0ffd2016-08-24 07:48:42 -0700262 }
kjellander0f380d82016-06-01 04:48:26 -0700263
mbonadei9452c622017-04-27 12:29:29 -0700264 rtc_test("test_support_unittests") {
mbonadei3edccb92017-06-01 04:47:20 -0700265 deps = [
266 ":fake_audio_device",
267 ":rtp_test_utils",
268 "../api:video_frame_api",
269 "../base:rtc_base_approved",
270 "../call:call_interfaces",
271 "../common_audio",
272 "../modules/rtp_rtcp",
273 "../system_wrappers",
274 ]
mbonadei9452c622017-04-27 12:29:29 -0700275 sources = [
276 "fake_audio_device_unittest.cc",
277 "fake_network_pipe_unittest.cc",
278 "frame_generator_unittest.cc",
279 "rtp_file_reader_unittest.cc",
280 "rtp_file_writer_unittest.cc",
281 "testsupport/always_passing_unittest.cc",
282 "testsupport/isolated_output_unittest.cc",
283 "testsupport/metrics/video_metrics_unittest.cc",
284 "testsupport/packet_reader_unittest.cc",
285 "testsupport/perf_test_unittest.cc",
286 "testsupport/y4m_frame_writer_unittest.cc",
287 "testsupport/yuv_frame_reader_unittest.cc",
288 "testsupport/yuv_frame_writer_unittest.cc",
289 ]
kjellander28a0ffd2016-08-24 07:48:42 -0700290
mbonadei9452c622017-04-27 12:29:29 -0700291 # TODO(jschuh): Bug 1348: fix this warning.
292 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
293
294 if (is_win) {
295 # virtual override w/different const/volatile signature.
296 cflags = [ "/wd4373" ]
297 }
298
299 if (!build_with_chromium && is_clang) {
300 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
301 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
302 }
303
304 data = test_support_unittests_resources
305 if (is_android) {
306 deps += [ "//testing/android/native_test:native_test_support" ]
307 shard_timeout = 900
308 }
309
310 if (is_ios) {
311 deps += [ ":test_support_unittests_bundle_data" ]
312 }
313
314 deps += [
315 ":direct_transport",
316 ":fileutils_unittests",
317 ":test_common",
318 ":test_main",
mbonadei148d5a22017-04-28 05:24:50 -0700319 ":test_support_isolated_output",
mbonadei9452c622017-04-27 12:29:29 -0700320 ":video_test_common",
321 ":video_test_support",
322 "../modules/video_capture",
323 "//testing/gmock",
324 "//testing/gtest",
325 "//third_party/gflags",
326 ]
327 }
kjellander0f380d82016-06-01 04:48:26 -0700328}
mbonadei9452c622017-04-27 12:29:29 -0700329
330rtc_source_set("fileutils") {
331 testonly = true
332 sources = [
333 "testsupport/fileutils.cc",
334 "testsupport/fileutils.h",
335 ]
mbonadei3edccb92017-06-01 04:47:20 -0700336 deps = [
337 "..:webrtc_common",
338 "../base:rtc_base_approved",
339 ]
mbonadei9452c622017-04-27 12:29:29 -0700340 if (is_ios) {
341 sources += [ "testsupport/iosfileutils.mm" ]
mbonadei3edccb92017-06-01 04:47:20 -0700342 deps += [ "../sdk:objc_common" ]
343 }
344 if (is_win) {
345 deps += [ "../base:rtc_base" ]
mbonadei9452c622017-04-27 12:29:29 -0700346 }
347 visibility = [ ":*" ]
348}
349
350rtc_source_set("run_test") {
351 testonly = true
352 sources = [
353 "run_test.h",
354 ]
355 if (is_mac) {
356 sources += [ "mac/run_test.mm" ]
357 } else {
358 sources += [ "run_test.cc" ]
359 }
360}
361
ehmaldonado37535bf2016-12-05 06:42:45 -0800362rtc_source_set("fileutils_unittests") {
363 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700364 visibility = [ ":*" ] # Only targets in this file can depend on this.
ehmaldonado37535bf2016-12-05 06:42:45 -0800365 sources = [
366 "testsupport/fileutils_unittest.cc",
367 ]
368 deps = [
369 ":fileutils",
mbonadei3edccb92017-06-01 04:47:20 -0700370 ":test_support",
371 "../base:rtc_base_approved",
ehmaldonado37535bf2016-12-05 06:42:45 -0800372 "//testing/gmock",
373 "//testing/gtest",
374 ]
375}
kjellander0f380d82016-06-01 04:48:26 -0700376
perkj488c5dc2017-02-08 05:55:51 -0800377rtc_source_set("direct_transport") {
378 testonly = true
379 sources = [
380 "direct_transport.cc",
381 "direct_transport.h",
382 "fake_network_pipe.cc",
383 "fake_network_pipe.h",
384 ]
385 if (!build_with_chromium && is_clang) {
386 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
387 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
388 }
389 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700390 "..:webrtc_common",
perkj488c5dc2017-02-08 05:55:51 -0800391 "../api:transport_api",
392 "../base:rtc_base_approved",
393 "../call",
mbonadei3edccb92017-06-01 04:47:20 -0700394 "../modules/rtp_rtcp",
395 "../system_wrappers",
perkj488c5dc2017-02-08 05:55:51 -0800396 ]
397}
398
perkj16ccfdf2017-02-28 14:41:05 -0800399rtc_source_set("fake_audio_device") {
400 testonly = true
401 sources = [
402 "fake_audio_device.cc",
403 "fake_audio_device.h",
404 ]
405 if (!build_with_chromium && is_clang) {
406 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
407 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
408 }
409 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700410 "..:webrtc_common",
perkj16ccfdf2017-02-28 14:41:05 -0800411 "../base:rtc_base_approved",
mbonadei3edccb92017-06-01 04:47:20 -0700412 "../common_audio:common_audio",
mbonadeib80ef8c2017-04-24 13:05:47 -0700413 "../modules/audio_device:audio_device",
mbonadei3edccb92017-06-01 04:47:20 -0700414 "../system_wrappers:system_wrappers",
perkj16ccfdf2017-02-28 14:41:05 -0800415 ]
416}
417
ehmaldonado38a21322016-09-02 04:10:34 -0700418rtc_source_set("test_common") {
kjellander0f380d82016-06-01 04:48:26 -0700419 testonly = true
420 sources = [
421 "call_test.cc",
422 "call_test.h",
423 "configurable_frame_size_encoder.cc",
424 "configurable_frame_size_encoder.h",
425 "constants.cc",
426 "constants.h",
kjellander0f380d82016-06-01 04:48:26 -0700427 "drifting_clock.cc",
428 "drifting_clock.h",
429 "encoder_settings.cc",
430 "encoder_settings.h",
kjellander0f380d82016-06-01 04:48:26 -0700431 "fake_decoder.cc",
432 "fake_decoder.h",
433 "fake_encoder.cc",
434 "fake_encoder.h",
sakal55d932b2016-09-30 06:19:08 -0700435 "fake_videorenderer.h",
kjellander0f380d82016-06-01 04:48:26 -0700436 "layer_filtering_transport.cc",
437 "layer_filtering_transport.h",
438 "mock_transport.h",
439 "mock_voe_channel_proxy.h",
440 "mock_voice_engine.h",
441 "null_transport.cc",
442 "null_transport.h",
443 "rtp_rtcp_observer.h",
444 "statistics.cc",
445 "statistics.h",
kjellander0f380d82016-06-01 04:48:26 -0700446 "win/run_loop_win.cc",
447 ]
448 if (!is_win) {
449 sources += [
450 "run_loop.cc",
451 "run_loop.h",
452 ]
453 }
454
kjellandere40a7ee2016-10-16 23:56:12 -0700455 if (!build_with_chromium && is_clang) {
456 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700457 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700458 }
459
460 deps = [
perkj488c5dc2017-02-08 05:55:51 -0800461 ":direct_transport",
perkj16ccfdf2017-02-28 14:41:05 -0800462 ":fake_audio_device",
kjellander0f380d82016-06-01 04:48:26 -0700463 ":rtp_test_utils",
464 ":test_support",
perkjc5726c12017-03-01 03:37:08 -0800465 ":video_test_common",
mbonadei3edccb92017-06-01 04:47:20 -0700466 "..:video_stream_api",
kjellander0f380d82016-06-01 04:48:26 -0700467 "..:webrtc_common",
mbonadei3edccb92017-06-01 04:47:20 -0700468 "../api:transport_api",
469 "../api:video_frame_api",
470 "../api/audio_codecs:builtin_audio_decoder_factory",
ossueb1fde42017-05-02 06:46:30 -0700471 "../api/audio_codecs:builtin_audio_encoder_factory",
ilnikd60d06a2017-04-05 03:02:20 -0700472 "../api/video_codecs:video_codecs_api",
kjellander94cee312016-06-10 01:56:57 -0700473 "../audio",
kjellander0f380d82016-06-01 04:48:26 -0700474 "../base:rtc_base_approved",
mbonadei3edccb92017-06-01 04:47:20 -0700475 "../base:rtc_task_queue",
kjellander94cee312016-06-10 01:56:57 -0700476 "../call",
mbonadei3edccb92017-06-01 04:47:20 -0700477 "../common_video",
478 "../logging:rtc_event_log_api",
479 "../modules/audio_device:mock_audio_device",
aleloi10111bc2016-11-17 06:48:48 -0800480 "../modules/audio_mixer:audio_mixer_impl",
aleloidd310712016-11-17 06:28:59 -0800481 "../modules/audio_processing",
mbonadei3edccb92017-06-01 04:47:20 -0700482 "../modules/rtp_rtcp",
483 "../modules/rtp_rtcp:mock_rtp_rtcp",
484 "../modules/video_coding:webrtc_h264",
485 "../modules/video_coding:webrtc_vp8",
486 "../modules/video_coding:webrtc_vp9",
487 "../system_wrappers",
kjellander94cee312016-06-10 01:56:57 -0700488 "../video",
mbonadei3edccb92017-06-01 04:47:20 -0700489 "../voice_engine",
kjellander0f380d82016-06-01 04:48:26 -0700490 "//testing/gmock",
491 "//testing/gtest",
kjellander0f380d82016-06-01 04:48:26 -0700492 ]
mbonadei148d5a22017-04-28 05:24:50 -0700493 if (!is_android && !build_with_chromium) {
oprypin92220ff2017-03-23 03:40:03 -0700494 deps += [ "../modules/video_capture:video_capture_internal_impl" ]
495 }
kjellander0f380d82016-06-01 04:48:26 -0700496}
497
498config("test_renderer_exported_config") {
499 if (is_win && is_clang) {
500 # GN orders flags on a target before flags from configs. The default config
501 # adds -Wall, and this flag have to be after -Wall -- so they need to
502 # come from a config and cannot be on the target directly.
ehmaldonado4bc4d272016-08-25 04:15:40 -0700503 cflags = [
kjellander0f380d82016-06-01 04:48:26 -0700504 "-Wno-bool-conversion",
505 "-Wno-comment",
506 "-Wno-delete-non-virtual-dtor",
507 ]
508 }
509}
510
ehmaldonado38a21322016-09-02 04:10:34 -0700511rtc_source_set("test_renderer") {
kjellander0f380d82016-06-01 04:48:26 -0700512 testonly = true
513 libs = []
514 sources = [
515 "linux/glx_renderer.cc",
516 "linux/glx_renderer.h",
517 "linux/video_renderer_linux.cc",
518 "mac/video_renderer_mac.h",
519 "mac/video_renderer_mac.mm",
520 "video_renderer.cc",
521 "video_renderer.h",
522 "win/d3d_renderer.cc",
523 "win/d3d_renderer.h",
524 ]
525 if (!is_linux && !is_mac && !is_win) {
526 sources += [ "null_platform_renderer.cc" ]
527 }
528 if (is_linux || is_mac) {
529 sources += [
530 "gl/gl_renderer.cc",
531 "gl/gl_renderer.h",
532 ]
533 }
534
535 if (is_linux) {
536 libs += [
537 "Xext",
538 "X11",
539 "GL",
540 ]
541 }
542 if (is_android) {
543 libs += [
544 "GLESv2",
545 "log",
546 ]
547 }
548 if (is_mac) {
549 libs = [
550 "Cocoa.framework",
551 "OpenGL.framework",
552 "CoreVideo.framework",
553 ]
554 }
555
ehmaldonadoe9cc6862016-09-05 06:10:18 -0700556 public_configs = [ ":test_renderer_exported_config" ]
kjellander0f380d82016-06-01 04:48:26 -0700557
kjellandere40a7ee2016-10-16 23:56:12 -0700558 if (!build_with_chromium && is_clang) {
559 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
ehmaldonado38a21322016-09-02 04:10:34 -0700560 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
kjellander0f380d82016-06-01 04:48:26 -0700561 }
562
563 deps = [
564 ":test_support",
mbonadei3edccb92017-06-01 04:47:20 -0700565 "..:webrtc_common",
566 "../base:rtc_base_approved",
567 "../common_video",
kjellander0f380d82016-06-01 04:48:26 -0700568 "../modules/media_file",
569 "//testing/gtest",
570 ]
571}
kwiberg37e99fd2017-04-10 05:15:48 -0700572
573rtc_source_set("audio_codec_mocks") {
574 testonly = true
575 sources = [
576 "mock_audio_decoder.h",
577 "mock_audio_decoder_factory.h",
ossueb1fde42017-05-02 06:46:30 -0700578 "mock_audio_encoder.cc",
579 "mock_audio_encoder.h",
580 "mock_audio_encoder_factory.h",
581 ]
582
583 deps = [
mbonadei3edccb92017-06-01 04:47:20 -0700584 ":test_support",
ossueb1fde42017-05-02 06:46:30 -0700585 "../api/audio_codecs:audio_codecs_api",
mbonadei3edccb92017-06-01 04:47:20 -0700586 "../api/audio_codecs:builtin_audio_decoder_factory",
587 "../base:rtc_base_approved",
ossueb1fde42017-05-02 06:46:30 -0700588 "//testing/gmock",
kwiberg37e99fd2017-04-10 05:15:48 -0700589 ]
590}
sakald7fdb802017-05-26 01:51:53 -0700591
592if (!build_with_chromium && is_android) {
593 android_library("native_test_java") {
594 testonly = true
595 java_files = [
596 "android/org/webrtc/native_test/RTCNativeUnitTest.java",
597 "android/org/webrtc/native_test/RTCNativeUnitTestActivity.java",
598 ]
599 deps = [
600 "//testing/android/native_test:native_test_java",
601 "//webrtc/base:base_java",
602 ]
603 }
604}