kjellander@webrtc.org | b8caf6a | 2014-09-30 18:05:02 +0000 | [diff] [blame] | 1 | # 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 | |
mbonadei | 9aa3f0a | 2017-01-24 06:58:22 -0800 | [diff] [blame] | 9 | import("../webrtc.gni") |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 10 | import("//build/config/ui.gni") |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 11 | if (is_android) { |
| 12 | import("//build/config/android/rules.gni") |
| 13 | } |
ehmaldonado | ed8c8ed | 2016-11-23 12:58:35 -0800 | [diff] [blame] | 14 | if (rtc_use_memcheck) { |
Henrik Kjellander | 90fd7d8 | 2017-05-09 08:30:10 +0200 | [diff] [blame] | 15 | import("//tools_webrtc/valgrind/valgrind-webrtc.gni") |
ehmaldonado | ed8c8ed | 2016-11-23 12:58:35 -0800 | [diff] [blame] | 16 | } |
kjellander@webrtc.org | b8caf6a | 2014-09-30 18:05:02 +0000 | [diff] [blame] | 17 | |
kjellander | b62dbbe | 2016-09-23 00:38:52 -0700 | [diff] [blame] | 18 | group("test") { |
kjellander@webrtc.org | b8caf6a | 2014-09-30 18:05:02 +0000 | [diff] [blame] | 19 | testonly = true |
| 20 | |
| 21 | deps = [ |
| 22 | ":field_trial", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 23 | ":rtp_test_utils", |
| 24 | ":test_common", |
| 25 | ":test_renderer", |
kjellander@webrtc.org | b8caf6a | 2014-09-30 18:05:02 +0000 | [diff] [blame] | 26 | ":test_support", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 27 | ":video_test_common", |
| 28 | ] |
mbonadei | 148d5a2 | 2017-04-28 05:24:50 -0700 | [diff] [blame] | 29 | |
| 30 | if (!build_with_chromium) { |
| 31 | deps += [ |
| 32 | ":test_main", |
| 33 | ":test_support_unittests", |
| 34 | ] |
| 35 | } |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 36 | } |
| 37 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 38 | rtc_source_set("video_test_common") { |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 39 | testonly = true |
| 40 | sources = [ |
| 41 | "fake_texture_frame.cc", |
| 42 | "fake_texture_frame.h", |
| 43 | "frame_generator.cc", |
| 44 | "frame_generator.h", |
ehmaldonado | 656610f | 2017-02-06 02:21:11 -0800 | [diff] [blame] | 45 | "frame_generator_capturer.cc", |
| 46 | "frame_generator_capturer.h", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 47 | "frame_utils.cc", |
| 48 | "frame_utils.h", |
ehmaldonado | 656610f | 2017-02-06 02:21:11 -0800 | [diff] [blame] | 49 | "vcm_capturer.cc", |
| 50 | "vcm_capturer.h", |
sprang | c5d62e2 | 2017-04-02 23:53:04 -0700 | [diff] [blame] | 51 | "video_capturer.cc", |
ehmaldonado | 656610f | 2017-02-06 02:21:11 -0800 | [diff] [blame] | 52 | "video_capturer.h", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 53 | ] |
| 54 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 55 | if (!build_with_chromium && is_clang) { |
| 56 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 57 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | deps = [ |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 61 | "..:video_stream_api", |
| 62 | "..:webrtc_common", |
| 63 | "../base:rtc_base_approved", |
| 64 | "../base:rtc_task_queue", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 65 | "../common_video", |
sprang | c5d62e2 | 2017-04-02 23:53:04 -0700 | [diff] [blame] | 66 | "../media:rtc_media_base", |
ehmaldonado | 656610f | 2017-02-06 02:21:11 -0800 | [diff] [blame] | 67 | "../modules/video_capture:video_capture_module", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 68 | "../system_wrappers", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 69 | ] |
| 70 | } |
| 71 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 72 | rtc_source_set("rtp_test_utils") { |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 73 | 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 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 83 | if (!build_with_chromium && is_clang) { |
| 84 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 85 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | deps = [ |
| 89 | "..:webrtc_common", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 90 | "../base:rtc_base_approved", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 91 | "../modules/rtp_rtcp", |
| 92 | "//testing/gtest", |
kjellander@webrtc.org | b8caf6a | 2014-09-30 18:05:02 +0000 | [diff] [blame] | 93 | ] |
| 94 | } |
| 95 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 96 | rtc_source_set("field_trial") { |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 97 | testonly = true |
kjellander@webrtc.org | b8caf6a | 2014-09-30 18:05:02 +0000 | [diff] [blame] | 98 | sources = [ |
| 99 | "field_trial.cc", |
| 100 | "field_trial.h", |
| 101 | ] |
| 102 | |
| 103 | deps = [ |
kwiberg@webrtc.org | ac2d27d | 2015-02-26 13:59:22 +0000 | [diff] [blame] | 104 | "..:webrtc_common", |
kjellander@webrtc.org | b8caf6a | 2014-09-30 18:05:02 +0000 | [diff] [blame] | 105 | "../system_wrappers", |
phoglund | 37ebcf0 | 2016-01-08 05:04:57 -0800 | [diff] [blame] | 106 | "../system_wrappers:field_trial_default", |
kjellander@webrtc.org | b8caf6a | 2014-09-30 18:05:02 +0000 | [diff] [blame] | 107 | ] |
kjellander@webrtc.org | b8caf6a | 2014-09-30 18:05:02 +0000 | [diff] [blame] | 108 | } |
| 109 | |
mbonadei | 148d5a2 | 2017-04-28 05:24:50 -0700 | [diff] [blame] | 110 | rtc_source_set("test_support") { |
| 111 | testonly = true |
kjellander | 32c4a20 | 2016-08-30 02:53:49 -0700 | [diff] [blame] | 112 | |
mbonadei | 148d5a2 | 2017-04-28 05:24:50 -0700 | [diff] [blame] | 113 | 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 | |
Kári Tristan Helgason | e2baffb | 2017-06-09 10:31:58 +0200 | [diff] [blame^] | 125 | if (is_ios) { |
| 126 | sources += [ |
| 127 | "ios/test_support.h", |
| 128 | "ios/test_support.mm", |
| 129 | ] |
| 130 | } |
| 131 | |
mbonadei | 148d5a2 | 2017-04-28 05:24:50 -0700 | [diff] [blame] | 132 | deps = [ |
| 133 | "..:webrtc_common", |
| 134 | "../base:gtest_prod", |
| 135 | "../base:rtc_base_approved", |
| 136 | "../common_video", |
| 137 | "../system_wrappers", |
| 138 | "//testing/gmock", |
| 139 | "//testing/gtest", |
| 140 | ] |
| 141 | |
| 142 | public_deps = [ |
| 143 | ":fileutils", |
| 144 | ] |
| 145 | |
| 146 | if (!build_with_chromium && is_clang) { |
| 147 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 148 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 149 | } |
| 150 | |
| 151 | if (is_android) { |
| 152 | deps += [ "//base:base" ] |
| 153 | } |
| 154 | |
| 155 | if (is_ios && !build_with_chromium) { |
mbonadei | 2c8ac1b | 2017-05-31 05:14:26 -0700 | [diff] [blame] | 156 | deps += [ "../sdk:objc_common" ] |
mbonadei | 148d5a2 | 2017-04-28 05:24:50 -0700 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | if (rtc_use_memcheck) { |
| 160 | data = valgrind_webrtc_dependencies |
kjellander | 32c4a20 | 2016-08-30 02:53:49 -0700 | [diff] [blame] | 161 | } |
| 162 | } |
| 163 | |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 164 | if (!build_with_chromium) { |
| 165 | # This target depends on //third_party/gflags and since chromium does not |
| 166 | # have gflags it causes an error when Gn parses this BUILD.gn file. |
| 167 | # It seems that Gn eagerly tries to understand if all the targets are |
| 168 | # buildable (even deps). Obviously gflags is not buildable in chromium |
| 169 | # so if a target depends on this BUILD.gn file we hit this error. |
| 170 | rtc_source_set("test_main") { |
| 171 | testonly = true |
| 172 | sources = [ |
| 173 | "test_main.cc", |
| 174 | ] |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 175 | |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 176 | public_deps = [ |
| 177 | ":test_support", |
| 178 | ] |
| 179 | deps = [ |
| 180 | ":field_trial", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 181 | "../base:rtc_base_approved", |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 182 | "../system_wrappers:metrics_default", |
| 183 | "//testing/gmock", |
| 184 | "//testing/gtest", |
| 185 | "//third_party/gflags", |
| 186 | ] |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 187 | } |
| 188 | |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 189 | rtc_source_set("video_test_support") { |
| 190 | testonly = true |
| 191 | |
| 192 | sources = [ |
| 193 | "testsupport/frame_reader.h", |
| 194 | "testsupport/frame_writer.h", |
| 195 | "testsupport/metrics/video_metrics.cc", |
| 196 | "testsupport/metrics/video_metrics.h", |
| 197 | "testsupport/mock/mock_frame_reader.h", |
| 198 | "testsupport/mock/mock_frame_writer.h", |
| 199 | "testsupport/y4m_frame_writer.cc", |
| 200 | "testsupport/yuv_frame_reader.cc", |
| 201 | "testsupport/yuv_frame_writer.cc", |
| 202 | ] |
| 203 | |
| 204 | deps = [ |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 205 | ":test_support", |
| 206 | ":video_test_common", |
| 207 | "..:webrtc_common", |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 208 | "../base:rtc_base_approved", |
| 209 | "../common_video", |
| 210 | "../system_wrappers", |
| 211 | "//testing/gmock", |
| 212 | "//testing/gtest", |
| 213 | "//third_party/gflags", |
| 214 | ] |
| 215 | |
| 216 | public_deps = [ |
| 217 | ":fileutils", |
| 218 | ] |
| 219 | |
| 220 | if (!build_with_chromium && is_clang) { |
| 221 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 222 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 223 | } |
| 224 | |
| 225 | if (is_android) { |
| 226 | deps += [ "//base:base" ] |
| 227 | } |
| 228 | |
| 229 | if (is_ios) { |
mbonadei | 2c8ac1b | 2017-05-31 05:14:26 -0700 | [diff] [blame] | 230 | deps += [ "../sdk:objc_common" ] |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | if (rtc_use_memcheck) { |
| 234 | data = valgrind_webrtc_dependencies |
| 235 | } |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 236 | } |
| 237 | |
mbonadei | 148d5a2 | 2017-04-28 05:24:50 -0700 | [diff] [blame] | 238 | rtc_source_set("test_support_isolated_output") { |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 239 | testonly = true |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 240 | sources = [ |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 241 | "testsupport/isolated_output.cc", |
| 242 | "testsupport/isolated_output.h", |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 243 | ] |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 244 | deps = [ |
mbonadei | 148d5a2 | 2017-04-28 05:24:50 -0700 | [diff] [blame] | 245 | ":fileutils", |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 246 | "../base:rtc_base_approved", |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 247 | "//third_party/gflags", |
| 248 | ] |
mbonadei | 148d5a2 | 2017-04-28 05:24:50 -0700 | [diff] [blame] | 249 | } |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 250 | |
mbonadei | 148d5a2 | 2017-04-28 05:24:50 -0700 | [diff] [blame] | 251 | test_support_unittests_resources = [ |
| 252 | "//resources/foreman_cif_short.yuv", |
| 253 | "//resources/video_coding/frame-ethernet-ii.pcap", |
| 254 | "//resources/video_coding/frame-loopback.pcap", |
| 255 | "//resources/video_coding/pltype103.rtp", |
| 256 | "//resources/video_coding/pltype103_header_only.rtp", |
| 257 | "//resources/video_coding/ssrcs-2.pcap", |
| 258 | "//resources/video_coding/ssrcs-3.pcap", |
| 259 | ] |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 260 | |
mbonadei | 148d5a2 | 2017-04-28 05:24:50 -0700 | [diff] [blame] | 261 | if (is_ios) { |
| 262 | bundle_data("test_support_unittests_bundle_data") { |
| 263 | testonly = true |
| 264 | sources = test_support_unittests_resources |
| 265 | outputs = [ |
| 266 | "{{bundle_resources_dir}}/{{source_file_part}}", |
| 267 | ] |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 268 | } |
kjellander | 28a0ffd | 2016-08-24 07:48:42 -0700 | [diff] [blame] | 269 | } |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 270 | |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 271 | rtc_test("test_support_unittests") { |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 272 | deps = [ |
| 273 | ":fake_audio_device", |
| 274 | ":rtp_test_utils", |
| 275 | "../api:video_frame_api", |
| 276 | "../base:rtc_base_approved", |
| 277 | "../call:call_interfaces", |
| 278 | "../common_audio", |
| 279 | "../modules/rtp_rtcp", |
| 280 | "../system_wrappers", |
| 281 | ] |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 282 | sources = [ |
| 283 | "fake_audio_device_unittest.cc", |
| 284 | "fake_network_pipe_unittest.cc", |
| 285 | "frame_generator_unittest.cc", |
| 286 | "rtp_file_reader_unittest.cc", |
| 287 | "rtp_file_writer_unittest.cc", |
| 288 | "testsupport/always_passing_unittest.cc", |
| 289 | "testsupport/isolated_output_unittest.cc", |
| 290 | "testsupport/metrics/video_metrics_unittest.cc", |
| 291 | "testsupport/packet_reader_unittest.cc", |
| 292 | "testsupport/perf_test_unittest.cc", |
| 293 | "testsupport/y4m_frame_writer_unittest.cc", |
| 294 | "testsupport/yuv_frame_reader_unittest.cc", |
| 295 | "testsupport/yuv_frame_writer_unittest.cc", |
| 296 | ] |
kjellander | 28a0ffd | 2016-08-24 07:48:42 -0700 | [diff] [blame] | 297 | |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 298 | # TODO(jschuh): Bug 1348: fix this warning. |
| 299 | configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| 300 | |
| 301 | if (is_win) { |
| 302 | # virtual override w/different const/volatile signature. |
| 303 | cflags = [ "/wd4373" ] |
| 304 | } |
| 305 | |
| 306 | if (!build_with_chromium && is_clang) { |
| 307 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 308 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 309 | } |
| 310 | |
| 311 | data = test_support_unittests_resources |
| 312 | if (is_android) { |
| 313 | deps += [ "//testing/android/native_test:native_test_support" ] |
| 314 | shard_timeout = 900 |
| 315 | } |
| 316 | |
| 317 | if (is_ios) { |
| 318 | deps += [ ":test_support_unittests_bundle_data" ] |
| 319 | } |
| 320 | |
| 321 | deps += [ |
| 322 | ":direct_transport", |
| 323 | ":fileutils_unittests", |
| 324 | ":test_common", |
| 325 | ":test_main", |
mbonadei | 148d5a2 | 2017-04-28 05:24:50 -0700 | [diff] [blame] | 326 | ":test_support_isolated_output", |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 327 | ":video_test_common", |
| 328 | ":video_test_support", |
| 329 | "../modules/video_capture", |
| 330 | "//testing/gmock", |
| 331 | "//testing/gtest", |
| 332 | "//third_party/gflags", |
| 333 | ] |
| 334 | } |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 335 | } |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 336 | |
| 337 | rtc_source_set("fileutils") { |
| 338 | testonly = true |
| 339 | sources = [ |
| 340 | "testsupport/fileutils.cc", |
| 341 | "testsupport/fileutils.h", |
| 342 | ] |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 343 | deps = [ |
| 344 | "..:webrtc_common", |
| 345 | "../base:rtc_base_approved", |
| 346 | ] |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 347 | if (is_ios) { |
| 348 | sources += [ "testsupport/iosfileutils.mm" ] |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 349 | deps += [ "../sdk:objc_common" ] |
| 350 | } |
| 351 | if (is_win) { |
| 352 | deps += [ "../base:rtc_base" ] |
mbonadei | 9452c62 | 2017-04-27 12:29:29 -0700 | [diff] [blame] | 353 | } |
| 354 | visibility = [ ":*" ] |
| 355 | } |
| 356 | |
| 357 | rtc_source_set("run_test") { |
| 358 | testonly = true |
| 359 | sources = [ |
| 360 | "run_test.h", |
| 361 | ] |
| 362 | if (is_mac) { |
| 363 | sources += [ "mac/run_test.mm" ] |
| 364 | } else { |
| 365 | sources += [ "run_test.cc" ] |
| 366 | } |
| 367 | } |
| 368 | |
ehmaldonado | 37535bf | 2016-12-05 06:42:45 -0800 | [diff] [blame] | 369 | rtc_source_set("fileutils_unittests") { |
| 370 | testonly = true |
kjellander | e0629c0 | 2017-04-25 04:04:50 -0700 | [diff] [blame] | 371 | visibility = [ ":*" ] # Only targets in this file can depend on this. |
ehmaldonado | 37535bf | 2016-12-05 06:42:45 -0800 | [diff] [blame] | 372 | sources = [ |
| 373 | "testsupport/fileutils_unittest.cc", |
| 374 | ] |
| 375 | deps = [ |
| 376 | ":fileutils", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 377 | ":test_support", |
| 378 | "../base:rtc_base_approved", |
ehmaldonado | 37535bf | 2016-12-05 06:42:45 -0800 | [diff] [blame] | 379 | "//testing/gmock", |
| 380 | "//testing/gtest", |
| 381 | ] |
| 382 | } |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 383 | |
perkj | 488c5dc | 2017-02-08 05:55:51 -0800 | [diff] [blame] | 384 | rtc_source_set("direct_transport") { |
| 385 | testonly = true |
| 386 | sources = [ |
| 387 | "direct_transport.cc", |
| 388 | "direct_transport.h", |
| 389 | "fake_network_pipe.cc", |
| 390 | "fake_network_pipe.h", |
| 391 | ] |
| 392 | if (!build_with_chromium && is_clang) { |
| 393 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 394 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 395 | } |
| 396 | deps = [ |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 397 | "..:webrtc_common", |
perkj | 488c5dc | 2017-02-08 05:55:51 -0800 | [diff] [blame] | 398 | "../api:transport_api", |
| 399 | "../base:rtc_base_approved", |
| 400 | "../call", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 401 | "../modules/rtp_rtcp", |
| 402 | "../system_wrappers", |
perkj | 488c5dc | 2017-02-08 05:55:51 -0800 | [diff] [blame] | 403 | ] |
| 404 | } |
| 405 | |
perkj | 16ccfdf | 2017-02-28 14:41:05 -0800 | [diff] [blame] | 406 | rtc_source_set("fake_audio_device") { |
| 407 | testonly = true |
| 408 | sources = [ |
| 409 | "fake_audio_device.cc", |
| 410 | "fake_audio_device.h", |
| 411 | ] |
| 412 | if (!build_with_chromium && is_clang) { |
| 413 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 414 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 415 | } |
| 416 | deps = [ |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 417 | "..:webrtc_common", |
perkj | 16ccfdf | 2017-02-28 14:41:05 -0800 | [diff] [blame] | 418 | "../base:rtc_base_approved", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 419 | "../common_audio:common_audio", |
mbonadei | b80ef8c | 2017-04-24 13:05:47 -0700 | [diff] [blame] | 420 | "../modules/audio_device:audio_device", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 421 | "../system_wrappers:system_wrappers", |
perkj | 16ccfdf | 2017-02-28 14:41:05 -0800 | [diff] [blame] | 422 | ] |
| 423 | } |
| 424 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 425 | rtc_source_set("test_common") { |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 426 | testonly = true |
| 427 | sources = [ |
| 428 | "call_test.cc", |
| 429 | "call_test.h", |
| 430 | "configurable_frame_size_encoder.cc", |
| 431 | "configurable_frame_size_encoder.h", |
| 432 | "constants.cc", |
| 433 | "constants.h", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 434 | "drifting_clock.cc", |
| 435 | "drifting_clock.h", |
| 436 | "encoder_settings.cc", |
| 437 | "encoder_settings.h", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 438 | "fake_decoder.cc", |
| 439 | "fake_decoder.h", |
| 440 | "fake_encoder.cc", |
| 441 | "fake_encoder.h", |
sakal | 55d932b | 2016-09-30 06:19:08 -0700 | [diff] [blame] | 442 | "fake_videorenderer.h", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 443 | "layer_filtering_transport.cc", |
| 444 | "layer_filtering_transport.h", |
| 445 | "mock_transport.h", |
| 446 | "mock_voe_channel_proxy.h", |
| 447 | "mock_voice_engine.h", |
| 448 | "null_transport.cc", |
| 449 | "null_transport.h", |
| 450 | "rtp_rtcp_observer.h", |
| 451 | "statistics.cc", |
| 452 | "statistics.h", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 453 | "win/run_loop_win.cc", |
| 454 | ] |
| 455 | if (!is_win) { |
| 456 | sources += [ |
| 457 | "run_loop.cc", |
| 458 | "run_loop.h", |
| 459 | ] |
| 460 | } |
| 461 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 462 | if (!build_with_chromium && is_clang) { |
| 463 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 464 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 465 | } |
| 466 | |
| 467 | deps = [ |
perkj | 488c5dc | 2017-02-08 05:55:51 -0800 | [diff] [blame] | 468 | ":direct_transport", |
perkj | 16ccfdf | 2017-02-28 14:41:05 -0800 | [diff] [blame] | 469 | ":fake_audio_device", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 470 | ":rtp_test_utils", |
| 471 | ":test_support", |
perkj | c5726c1 | 2017-03-01 03:37:08 -0800 | [diff] [blame] | 472 | ":video_test_common", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 473 | "..:video_stream_api", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 474 | "..:webrtc_common", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 475 | "../api:transport_api", |
| 476 | "../api:video_frame_api", |
| 477 | "../api/audio_codecs:builtin_audio_decoder_factory", |
ossu | eb1fde4 | 2017-05-02 06:46:30 -0700 | [diff] [blame] | 478 | "../api/audio_codecs:builtin_audio_encoder_factory", |
ilnik | d60d06a | 2017-04-05 03:02:20 -0700 | [diff] [blame] | 479 | "../api/video_codecs:video_codecs_api", |
kjellander | 94cee31 | 2016-06-10 01:56:57 -0700 | [diff] [blame] | 480 | "../audio", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 481 | "../base:rtc_base_approved", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 482 | "../base:rtc_task_queue", |
kjellander | 94cee31 | 2016-06-10 01:56:57 -0700 | [diff] [blame] | 483 | "../call", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 484 | "../common_video", |
| 485 | "../logging:rtc_event_log_api", |
| 486 | "../modules/audio_device:mock_audio_device", |
aleloi | 10111bc | 2016-11-17 06:48:48 -0800 | [diff] [blame] | 487 | "../modules/audio_mixer:audio_mixer_impl", |
aleloi | dd31071 | 2016-11-17 06:28:59 -0800 | [diff] [blame] | 488 | "../modules/audio_processing", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 489 | "../modules/rtp_rtcp", |
| 490 | "../modules/rtp_rtcp:mock_rtp_rtcp", |
| 491 | "../modules/video_coding:webrtc_h264", |
| 492 | "../modules/video_coding:webrtc_vp8", |
| 493 | "../modules/video_coding:webrtc_vp9", |
| 494 | "../system_wrappers", |
kjellander | 94cee31 | 2016-06-10 01:56:57 -0700 | [diff] [blame] | 495 | "../video", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 496 | "../voice_engine", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 497 | "//testing/gmock", |
| 498 | "//testing/gtest", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 499 | ] |
mbonadei | 148d5a2 | 2017-04-28 05:24:50 -0700 | [diff] [blame] | 500 | if (!is_android && !build_with_chromium) { |
oprypin | 92220ff | 2017-03-23 03:40:03 -0700 | [diff] [blame] | 501 | deps += [ "../modules/video_capture:video_capture_internal_impl" ] |
| 502 | } |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 503 | } |
| 504 | |
| 505 | config("test_renderer_exported_config") { |
| 506 | if (is_win && is_clang) { |
| 507 | # GN orders flags on a target before flags from configs. The default config |
| 508 | # adds -Wall, and this flag have to be after -Wall -- so they need to |
| 509 | # come from a config and cannot be on the target directly. |
ehmaldonado | 4bc4d27 | 2016-08-25 04:15:40 -0700 | [diff] [blame] | 510 | cflags = [ |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 511 | "-Wno-bool-conversion", |
| 512 | "-Wno-comment", |
| 513 | "-Wno-delete-non-virtual-dtor", |
| 514 | ] |
| 515 | } |
| 516 | } |
| 517 | |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 518 | rtc_source_set("test_renderer") { |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 519 | testonly = true |
| 520 | libs = [] |
| 521 | sources = [ |
| 522 | "linux/glx_renderer.cc", |
| 523 | "linux/glx_renderer.h", |
| 524 | "linux/video_renderer_linux.cc", |
| 525 | "mac/video_renderer_mac.h", |
| 526 | "mac/video_renderer_mac.mm", |
| 527 | "video_renderer.cc", |
| 528 | "video_renderer.h", |
| 529 | "win/d3d_renderer.cc", |
| 530 | "win/d3d_renderer.h", |
| 531 | ] |
| 532 | if (!is_linux && !is_mac && !is_win) { |
| 533 | sources += [ "null_platform_renderer.cc" ] |
| 534 | } |
| 535 | if (is_linux || is_mac) { |
| 536 | sources += [ |
| 537 | "gl/gl_renderer.cc", |
| 538 | "gl/gl_renderer.h", |
| 539 | ] |
| 540 | } |
| 541 | |
| 542 | if (is_linux) { |
| 543 | libs += [ |
| 544 | "Xext", |
| 545 | "X11", |
| 546 | "GL", |
| 547 | ] |
| 548 | } |
| 549 | if (is_android) { |
| 550 | libs += [ |
| 551 | "GLESv2", |
| 552 | "log", |
| 553 | ] |
| 554 | } |
| 555 | if (is_mac) { |
| 556 | libs = [ |
| 557 | "Cocoa.framework", |
| 558 | "OpenGL.framework", |
| 559 | "CoreVideo.framework", |
| 560 | ] |
| 561 | } |
| 562 | |
ehmaldonado | e9cc686 | 2016-09-05 06:10:18 -0700 | [diff] [blame] | 563 | public_configs = [ ":test_renderer_exported_config" ] |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 564 | |
kjellander | e40a7ee | 2016-10-16 23:56:12 -0700 | [diff] [blame] | 565 | if (!build_with_chromium && is_clang) { |
| 566 | # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
ehmaldonado | 38a2132 | 2016-09-02 04:10:34 -0700 | [diff] [blame] | 567 | suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 568 | } |
| 569 | |
| 570 | deps = [ |
| 571 | ":test_support", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 572 | "..:webrtc_common", |
| 573 | "../base:rtc_base_approved", |
| 574 | "../common_video", |
kjellander | 0f380d8 | 2016-06-01 04:48:26 -0700 | [diff] [blame] | 575 | "../modules/media_file", |
| 576 | "//testing/gtest", |
| 577 | ] |
| 578 | } |
kwiberg | 37e99fd | 2017-04-10 05:15:48 -0700 | [diff] [blame] | 579 | |
| 580 | rtc_source_set("audio_codec_mocks") { |
| 581 | testonly = true |
| 582 | sources = [ |
| 583 | "mock_audio_decoder.h", |
| 584 | "mock_audio_decoder_factory.h", |
ossu | eb1fde4 | 2017-05-02 06:46:30 -0700 | [diff] [blame] | 585 | "mock_audio_encoder.cc", |
| 586 | "mock_audio_encoder.h", |
| 587 | "mock_audio_encoder_factory.h", |
| 588 | ] |
| 589 | |
| 590 | deps = [ |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 591 | ":test_support", |
ossu | eb1fde4 | 2017-05-02 06:46:30 -0700 | [diff] [blame] | 592 | "../api/audio_codecs:audio_codecs_api", |
mbonadei | 3edccb9 | 2017-06-01 04:47:20 -0700 | [diff] [blame] | 593 | "../api/audio_codecs:builtin_audio_decoder_factory", |
| 594 | "../base:rtc_base_approved", |
ossu | eb1fde4 | 2017-05-02 06:46:30 -0700 | [diff] [blame] | 595 | "//testing/gmock", |
kwiberg | 37e99fd | 2017-04-10 05:15:48 -0700 | [diff] [blame] | 596 | ] |
| 597 | } |
sakal | d7fdb80 | 2017-05-26 01:51:53 -0700 | [diff] [blame] | 598 | |
| 599 | if (!build_with_chromium && is_android) { |
| 600 | android_library("native_test_java") { |
| 601 | testonly = true |
| 602 | java_files = [ |
| 603 | "android/org/webrtc/native_test/RTCNativeUnitTest.java", |
| 604 | "android/org/webrtc/native_test/RTCNativeUnitTestActivity.java", |
| 605 | ] |
| 606 | deps = [ |
| 607 | "//testing/android/native_test:native_test_java", |
| 608 | "//webrtc/base:base_java", |
| 609 | ] |
| 610 | } |
| 611 | } |