| OLD | NEW |
| 1 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 1 # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| 2 # | 2 # |
| 3 # Use of this source code is governed by a BSD-style license | 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 | 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 | 5 # tree. An additional intellectual property rights grant can be found |
| 6 # in the file PATENTS. All contributing project authors may | 6 # in the file PATENTS. All contributing project authors may |
| 7 # be found in the AUTHORS file in the root of the source tree. | 7 # be found in the AUTHORS file in the root of the source tree. |
| 8 | 8 |
| 9 import("../webrtc.gni") | 9 import("../webrtc.gni") |
| 10 import("//build/config/ui.gni") | 10 import("//build/config/ui.gni") |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 "field_trial.h", | 89 "field_trial.h", |
| 90 ] | 90 ] |
| 91 | 91 |
| 92 deps = [ | 92 deps = [ |
| 93 "..:webrtc_common", | 93 "..:webrtc_common", |
| 94 "../system_wrappers", | 94 "../system_wrappers", |
| 95 "../system_wrappers:field_trial_default", | 95 "../system_wrappers:field_trial_default", |
| 96 ] | 96 ] |
| 97 } | 97 } |
| 98 | 98 |
| 99 rtc_source_set("test_main") { | 99 test_support_unittests_resources = [ |
| 100 testonly = true | 100 "//resources/foreman_cif_short.yuv", |
| 101 sources = [ | 101 "//resources/video_coding/frame-ethernet-ii.pcap", |
| 102 "test_main.cc", | 102 "//resources/video_coding/frame-loopback.pcap", |
| 103 ] | 103 "//resources/video_coding/pltype103.rtp", |
| 104 | 104 "//resources/video_coding/pltype103_header_only.rtp", |
| 105 public_deps = [ | 105 "//resources/video_coding/ssrcs-2.pcap", |
| 106 ":test_support", | 106 "//resources/video_coding/ssrcs-3.pcap", |
| 107 ] | 107 ] |
| 108 deps = [ | 108 |
| 109 ":field_trial", | 109 if (is_ios) { |
| 110 "../system_wrappers:metrics_default", | 110 bundle_data("test_support_unittests_bundle_data") { |
| 111 "//testing/gmock", | 111 testonly = true |
| 112 "//testing/gtest", | 112 sources = test_support_unittests_resources |
| 113 "//third_party/gflags", | 113 outputs = [ |
| 114 ] | 114 "{{bundle_resources_dir}}/{{source_file_part}}", |
| 115 ] |
| 116 } |
| 117 } |
| 118 |
| 119 if (!build_with_chromium) { |
| 120 # This target depends on //third_party/gflags and since chromium does not |
| 121 # have gflags it causes an error when Gn parses this BUILD.gn file. |
| 122 # It seems that Gn eagerly tries to understand if all the targets are |
| 123 # buildable (even deps). Obviously gflags is not buildable in chromium |
| 124 # so if a target depends on this BUILD.gn file we hit this error. |
| 125 rtc_source_set("test_main") { |
| 126 testonly = true |
| 127 sources = [ |
| 128 "test_main.cc", |
| 129 ] |
| 130 |
| 131 public_deps = [ |
| 132 ":test_support", |
| 133 ] |
| 134 deps = [ |
| 135 ":field_trial", |
| 136 "../system_wrappers:metrics_default", |
| 137 "//testing/gmock", |
| 138 "//testing/gtest", |
| 139 "//third_party/gflags", |
| 140 ] |
| 141 } |
| 142 |
| 143 rtc_source_set("video_test_support") { |
| 144 testonly = true |
| 145 |
| 146 sources = [ |
| 147 "testsupport/frame_reader.h", |
| 148 "testsupport/frame_writer.h", |
| 149 "testsupport/metrics/video_metrics.cc", |
| 150 "testsupport/metrics/video_metrics.h", |
| 151 "testsupport/mock/mock_frame_reader.h", |
| 152 "testsupport/mock/mock_frame_writer.h", |
| 153 "testsupport/y4m_frame_writer.cc", |
| 154 "testsupport/yuv_frame_reader.cc", |
| 155 "testsupport/yuv_frame_writer.cc", |
| 156 ] |
| 157 |
| 158 deps = [ |
| 159 "../base:rtc_base_approved", |
| 160 "../common_video", |
| 161 "../system_wrappers", |
| 162 "//testing/gmock", |
| 163 "//testing/gtest", |
| 164 "//third_party/gflags", |
| 165 ] |
| 166 |
| 167 public_deps = [ |
| 168 ":fileutils", |
| 169 ] |
| 170 |
| 171 if (!build_with_chromium && is_clang) { |
| 172 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 173 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 174 } |
| 175 |
| 176 if (is_android) { |
| 177 deps += [ "//base:base" ] |
| 178 } |
| 179 |
| 180 if (is_ios) { |
| 181 deps += [ "//webrtc/sdk:rtc_sdk_common_objc" ] |
| 182 } |
| 183 |
| 184 if (rtc_use_memcheck) { |
| 185 data = valgrind_webrtc_dependencies |
| 186 } |
| 187 } |
| 188 |
| 189 rtc_source_set("test_support") { |
| 190 testonly = true |
| 191 |
| 192 sources = [ |
| 193 "gmock.h", |
| 194 "gtest.h", |
| 195 "testsupport/isolated_output.cc", |
| 196 "testsupport/isolated_output.h", |
| 197 "testsupport/packet_reader.cc", |
| 198 "testsupport/packet_reader.h", |
| 199 "testsupport/perf_test.cc", |
| 200 "testsupport/perf_test.h", |
| 201 "testsupport/trace_to_stderr.cc", |
| 202 "testsupport/trace_to_stderr.h", |
| 203 "testsupport/unittest_utils.h", |
| 204 ] |
| 205 |
| 206 deps = [ |
| 207 "../base:gtest_prod", |
| 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) { |
| 230 deps += [ "//webrtc/sdk:rtc_sdk_common_objc" ] |
| 231 } |
| 232 |
| 233 if (rtc_use_memcheck) { |
| 234 data = valgrind_webrtc_dependencies |
| 235 } |
| 236 } |
| 237 |
| 238 rtc_test("test_support_unittests") { |
| 239 deps = [] |
| 240 sources = [ |
| 241 "fake_audio_device_unittest.cc", |
| 242 "fake_network_pipe_unittest.cc", |
| 243 "frame_generator_unittest.cc", |
| 244 "rtp_file_reader_unittest.cc", |
| 245 "rtp_file_writer_unittest.cc", |
| 246 "testsupport/always_passing_unittest.cc", |
| 247 "testsupport/isolated_output_unittest.cc", |
| 248 "testsupport/metrics/video_metrics_unittest.cc", |
| 249 "testsupport/packet_reader_unittest.cc", |
| 250 "testsupport/perf_test_unittest.cc", |
| 251 "testsupport/y4m_frame_writer_unittest.cc", |
| 252 "testsupport/yuv_frame_reader_unittest.cc", |
| 253 "testsupport/yuv_frame_writer_unittest.cc", |
| 254 ] |
| 255 |
| 256 # TODO(jschuh): Bug 1348: fix this warning. |
| 257 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] |
| 258 |
| 259 if (is_win) { |
| 260 # virtual override w/different const/volatile signature. |
| 261 cflags = [ "/wd4373" ] |
| 262 } |
| 263 |
| 264 if (!build_with_chromium && is_clang) { |
| 265 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). |
| 266 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] |
| 267 } |
| 268 |
| 269 data = test_support_unittests_resources |
| 270 if (is_android) { |
| 271 deps += [ "//testing/android/native_test:native_test_support" ] |
| 272 shard_timeout = 900 |
| 273 } |
| 274 |
| 275 if (is_ios) { |
| 276 deps += [ ":test_support_unittests_bundle_data" ] |
| 277 } |
| 278 |
| 279 deps += [ |
| 280 ":direct_transport", |
| 281 ":fileutils_unittests", |
| 282 ":test_common", |
| 283 ":test_main", |
| 284 ":video_test_common", |
| 285 ":video_test_support", |
| 286 "../modules/video_capture", |
| 287 "//testing/gmock", |
| 288 "//testing/gtest", |
| 289 "//third_party/gflags", |
| 290 ] |
| 291 } |
| 115 } | 292 } |
| 116 | 293 |
| 117 rtc_source_set("fileutils") { | 294 rtc_source_set("fileutils") { |
| 118 testonly = true | 295 testonly = true |
| 119 sources = [ | 296 sources = [ |
| 120 "testsupport/fileutils.cc", | 297 "testsupport/fileutils.cc", |
| 121 "testsupport/fileutils.h", | 298 "testsupport/fileutils.h", |
| 122 ] | 299 ] |
| 123 if (is_ios) { | 300 if (is_ios) { |
| 124 sources += [ "testsupport/iosfileutils.mm" ] | 301 sources += [ "testsupport/iosfileutils.mm" ] |
| 125 } | 302 } |
| 126 visibility = [ ":*" ] | 303 visibility = [ ":*" ] |
| 127 } | 304 } |
| 128 | 305 |
| 129 rtc_source_set("video_test_support") { | |
| 130 testonly = true | |
| 131 | |
| 132 sources = [ | |
| 133 "testsupport/frame_reader.h", | |
| 134 "testsupport/frame_writer.h", | |
| 135 "testsupport/metrics/video_metrics.cc", | |
| 136 "testsupport/metrics/video_metrics.h", | |
| 137 "testsupport/mock/mock_frame_reader.h", | |
| 138 "testsupport/mock/mock_frame_writer.h", | |
| 139 "testsupport/y4m_frame_writer.cc", | |
| 140 "testsupport/yuv_frame_reader.cc", | |
| 141 "testsupport/yuv_frame_writer.cc", | |
| 142 ] | |
| 143 | |
| 144 deps = [ | |
| 145 "../base:rtc_base_approved", | |
| 146 "../common_video", | |
| 147 "../system_wrappers", | |
| 148 "//testing/gmock", | |
| 149 "//testing/gtest", | |
| 150 "//third_party/gflags", | |
| 151 ] | |
| 152 | |
| 153 public_deps = [ | |
| 154 ":fileutils", | |
| 155 ] | |
| 156 | |
| 157 if (!build_with_chromium && is_clang) { | |
| 158 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
| 159 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
| 160 } | |
| 161 | |
| 162 if (is_android) { | |
| 163 deps += [ "//base:base" ] | |
| 164 } | |
| 165 | |
| 166 if (is_ios) { | |
| 167 deps += [ "//webrtc/sdk:rtc_sdk_common_objc" ] | |
| 168 } | |
| 169 | |
| 170 if (rtc_use_memcheck) { | |
| 171 data = valgrind_webrtc_dependencies | |
| 172 } | |
| 173 } | |
| 174 | |
| 175 rtc_source_set("test_support") { | |
| 176 testonly = true | |
| 177 | |
| 178 sources = [ | |
| 179 "gmock.h", | |
| 180 "gtest.h", | |
| 181 "testsupport/isolated_output.cc", | |
| 182 "testsupport/isolated_output.h", | |
| 183 "testsupport/packet_reader.cc", | |
| 184 "testsupport/packet_reader.h", | |
| 185 "testsupport/perf_test.cc", | |
| 186 "testsupport/perf_test.h", | |
| 187 "testsupport/trace_to_stderr.cc", | |
| 188 "testsupport/trace_to_stderr.h", | |
| 189 "testsupport/unittest_utils.h", | |
| 190 ] | |
| 191 | |
| 192 deps = [ | |
| 193 "../base:gtest_prod", | |
| 194 "../base:rtc_base_approved", | |
| 195 "../common_video", | |
| 196 "../system_wrappers", | |
| 197 "//testing/gmock", | |
| 198 "//testing/gtest", | |
| 199 "//third_party/gflags", | |
| 200 ] | |
| 201 | |
| 202 public_deps = [ | |
| 203 ":fileutils", | |
| 204 ] | |
| 205 | |
| 206 if (!build_with_chromium && is_clang) { | |
| 207 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
| 208 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
| 209 } | |
| 210 | |
| 211 if (is_android) { | |
| 212 deps += [ "//base:base" ] | |
| 213 } | |
| 214 | |
| 215 if (is_ios) { | |
| 216 deps += [ "//webrtc/sdk:rtc_sdk_common_objc" ] | |
| 217 } | |
| 218 | |
| 219 if (rtc_use_memcheck) { | |
| 220 data = valgrind_webrtc_dependencies | |
| 221 } | |
| 222 } | |
| 223 | |
| 224 rtc_source_set("run_test") { | 306 rtc_source_set("run_test") { |
| 225 testonly = true | 307 testonly = true |
| 226 sources = [ | 308 sources = [ |
| 227 "run_test.h", | 309 "run_test.h", |
| 228 ] | 310 ] |
| 229 if (is_mac) { | 311 if (is_mac) { |
| 230 sources += [ "mac/run_test.mm" ] | 312 sources += [ "mac/run_test.mm" ] |
| 231 } else { | 313 } else { |
| 232 sources += [ "run_test.cc" ] | 314 sources += [ "run_test.cc" ] |
| 233 } | 315 } |
| 234 } | 316 } |
| 235 | 317 |
| 236 test_support_unittests_resources = [ | |
| 237 "//resources/foreman_cif_short.yuv", | |
| 238 "//resources/video_coding/frame-ethernet-ii.pcap", | |
| 239 "//resources/video_coding/frame-loopback.pcap", | |
| 240 "//resources/video_coding/pltype103.rtp", | |
| 241 "//resources/video_coding/pltype103_header_only.rtp", | |
| 242 "//resources/video_coding/ssrcs-2.pcap", | |
| 243 "//resources/video_coding/ssrcs-3.pcap", | |
| 244 ] | |
| 245 | |
| 246 if (is_ios) { | |
| 247 bundle_data("test_support_unittests_bundle_data") { | |
| 248 testonly = true | |
| 249 sources = test_support_unittests_resources | |
| 250 outputs = [ | |
| 251 "{{bundle_resources_dir}}/{{source_file_part}}", | |
| 252 ] | |
| 253 } | |
| 254 } | |
| 255 | |
| 256 rtc_test("test_support_unittests") { | |
| 257 deps = [] | |
| 258 sources = [ | |
| 259 "fake_audio_device_unittest.cc", | |
| 260 "fake_network_pipe_unittest.cc", | |
| 261 "frame_generator_unittest.cc", | |
| 262 "rtp_file_reader_unittest.cc", | |
| 263 "rtp_file_writer_unittest.cc", | |
| 264 "testsupport/always_passing_unittest.cc", | |
| 265 "testsupport/isolated_output_unittest.cc", | |
| 266 "testsupport/metrics/video_metrics_unittest.cc", | |
| 267 "testsupport/packet_reader_unittest.cc", | |
| 268 "testsupport/perf_test_unittest.cc", | |
| 269 "testsupport/y4m_frame_writer_unittest.cc", | |
| 270 "testsupport/yuv_frame_reader_unittest.cc", | |
| 271 "testsupport/yuv_frame_writer_unittest.cc", | |
| 272 ] | |
| 273 | |
| 274 # TODO(jschuh): Bug 1348: fix this warning. | |
| 275 configs += [ "//build/config/compiler:no_size_t_to_int_warning" ] | |
| 276 | |
| 277 if (is_win) { | |
| 278 cflags = [ "/wd4373" ] # virtual override w/different const/volatile signat
ure. | |
| 279 } | |
| 280 | |
| 281 if (!build_with_chromium && is_clang) { | |
| 282 # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). | |
| 283 suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] | |
| 284 } | |
| 285 | |
| 286 data = test_support_unittests_resources | |
| 287 if (is_android) { | |
| 288 deps += [ "//testing/android/native_test:native_test_support" ] | |
| 289 shard_timeout = 900 | |
| 290 } | |
| 291 | |
| 292 if (is_ios) { | |
| 293 deps += [ ":test_support_unittests_bundle_data" ] | |
| 294 } | |
| 295 | |
| 296 deps += [ | |
| 297 ":direct_transport", | |
| 298 ":fileutils_unittests", | |
| 299 ":test_common", | |
| 300 ":test_main", | |
| 301 ":video_test_common", | |
| 302 ":video_test_support", | |
| 303 "../modules/video_capture", | |
| 304 "//testing/gmock", | |
| 305 "//testing/gtest", | |
| 306 "//third_party/gflags", | |
| 307 ] | |
| 308 } | |
| 309 rtc_source_set("fileutils_unittests") { | 318 rtc_source_set("fileutils_unittests") { |
| 310 testonly = true | 319 testonly = true |
| 311 visibility = [ ":*" ] # Only targets in this file can depend on this. | 320 visibility = [ ":*" ] # Only targets in this file can depend on this. |
| 312 sources = [ | 321 sources = [ |
| 313 "testsupport/fileutils_unittest.cc", | 322 "testsupport/fileutils_unittest.cc", |
| 314 ] | 323 ] |
| 315 deps = [ | 324 deps = [ |
| 316 ":fileutils", | 325 ":fileutils", |
| 317 "//testing/gmock", | 326 "//testing/gmock", |
| 318 "//testing/gtest", | 327 "//testing/gtest", |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 ] | 500 ] |
| 492 } | 501 } |
| 493 | 502 |
| 494 rtc_source_set("audio_codec_mocks") { | 503 rtc_source_set("audio_codec_mocks") { |
| 495 testonly = true | 504 testonly = true |
| 496 sources = [ | 505 sources = [ |
| 497 "mock_audio_decoder.h", | 506 "mock_audio_decoder.h", |
| 498 "mock_audio_decoder_factory.h", | 507 "mock_audio_decoder_factory.h", |
| 499 ] | 508 ] |
| 500 } | 509 } |
| OLD | NEW |