1 # Copyright (c) 2011 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 9 # TODO(andrew): consider moving test_support to src/base/test. 10 { 11 'includes': [ 12 '../build/common.gypi', 13 ], 14 'targets': [ 15 { 16 'target_name': 'channel_transport', 17 'type': 'static_library', 18 'dependencies': [ 19 '<(DEPTH)/testing/gtest.gyp:gtest', 20 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers', 21 ], 22 'sources': [ 23 'channel_transport/channel_transport.cc', 24 'channel_transport/include/channel_transport.h', 25 'channel_transport/traffic_control_win.cc', 26 'channel_transport/traffic_control_win.h', 27 'channel_transport/udp_socket_manager_posix.cc', 28 'channel_transport/udp_socket_manager_posix.h', 29 'channel_transport/udp_socket_manager_wrapper.cc', 30 'channel_transport/udp_socket_manager_wrapper.h', 31 'channel_transport/udp_socket_posix.cc', 32 'channel_transport/udp_socket_posix.h', 33 'channel_transport/udp_socket_wrapper.cc', 34 'channel_transport/udp_socket_wrapper.h', 35 'channel_transport/udp_socket2_manager_win.cc', 36 'channel_transport/udp_socket2_manager_win.h', 37 'channel_transport/udp_socket2_win.cc', 38 'channel_transport/udp_socket2_win.h', 39 'channel_transport/udp_transport.h', 40 'channel_transport/udp_transport_impl.cc', 41 'channel_transport/udp_transport_impl.h', 42 ], 43 }, 44 { 45 'target_name': 'frame_generator', 46 'type': 'static_library', 47 'sources': [ 48 'frame_generator.cc', 49 'frame_generator.h', 50 ], 51 'dependencies': [ 52 '<(webrtc_root)/common_video/common_video.gyp:common_video', 53 ], 54 }, 55 { 56 'target_name': 'rtcp_packet_parser', 57 'type': 'static_library', 58 'sources': [ 59 'rtcp_packet_parser.cc', 60 'rtcp_packet_parser.h', 61 ], 62 'dependencies': [ 63 '<(webrtc_root)/modules/modules.gyp:rtp_rtcp', 64 ], 65 }, 66 { 67 'target_name': 'field_trial', 68 'type': 'static_library', 69 'sources': [ 70 'field_trial.cc', 71 'field_trial.h', 72 ], 73 'dependencies': [ 74 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers', 75 ], 76 }, 77 { 78 'target_name': 'test_main', 79 'type': 'static_library', 80 'sources': [ 81 'test_main.cc', 82 ], 83 'dependencies': [ 84 'field_trial', 85 '<(DEPTH)/testing/gtest.gyp:gtest', 86 '<(DEPTH)/third_party/gflags/gflags.gyp:gflags', 87 ], 88 }, 89 { 90 'target_name': 'test_support', 91 'type': 'static_library', 92 'dependencies': [ 93 '<(DEPTH)/testing/gtest.gyp:gtest', 94 '<(DEPTH)/testing/gmock.gyp:gmock', 95 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers', 96 ], 97 'sources': [ 98 'testsupport/android/root_path_android.cc', 99 'testsupport/android/root_path_android_chromium.cc', 100 'testsupport/fileutils.cc', 101 'testsupport/fileutils.h', 102 'testsupport/frame_reader.cc', 103 'testsupport/frame_reader.h', 104 'testsupport/frame_writer.cc', 105 'testsupport/frame_writer.h', 106 'testsupport/gtest_prod_util.h', 107 'testsupport/gtest_disable.h', 108 'testsupport/mock/mock_frame_reader.h', 109 'testsupport/mock/mock_frame_writer.h', 110 'testsupport/packet_reader.cc', 111 'testsupport/packet_reader.h', 112 'testsupport/perf_test.cc', 113 'testsupport/perf_test.h', 114 'testsupport/trace_to_stderr.cc', 115 'testsupport/trace_to_stderr.h', 116 ], 117 'conditions': [ 118 # TODO(henrike): remove build_with_chromium==1 when the bots are using 119 # Chromium's buildbots. 120 ['build_with_chromium==1 and OS=="android"', { 121 'dependencies': [ 122 '<(DEPTH)/base/base.gyp:base', 123 ], 124 'sources!': [ 125 'testsupport/android/root_path_android.cc', 126 ], 127 }, { 128 'sources!': [ 129 'testsupport/android/root_path_android_chromium.cc', 130 ], 131 }], 132 ], 133 }, 134 { 135 # Depend on this target when you want to have test_support but also the 136 # main method needed for gtest to execute! 137 'target_name': 'test_support_main', 138 'type': 'static_library', 139 'dependencies': [ 140 'field_trial', 141 'test_support', 142 '<(DEPTH)/testing/gmock.gyp:gmock', 143 '<(DEPTH)/testing/gtest.gyp:gtest', 144 '<(DEPTH)/third_party/gflags/gflags.gyp:gflags', 145 ], 146 'sources': [ 147 'run_all_unittests.cc', 148 'test_suite.cc', 149 'test_suite.h', 150 ], 151 }, 152 { 153 # Depend on this target when you want to have test_support and a special 154 # main for mac which will run your test on a worker thread and consume 155 # events on the main thread. Useful if you want to access a webcam. 156 # This main will provide all the scaffolding and objective-c black magic 157 # for you. All you need to do is to implement a function in the 158 # run_threaded_main_mac.h file (ImplementThisToRunYourTest). 159 'target_name': 'test_support_main_threaded_mac', 160 'type': 'static_library', 161 'dependencies': [ 162 'test_support', 163 ], 164 'sources': [ 165 'testsupport/mac/run_threaded_main_mac.h', 166 'testsupport/mac/run_threaded_main_mac.mm', 167 ], 168 }, 169 { 170 'target_name': 'test_support_unittests', 171 'type': '<(gtest_target_type)', 172 'dependencies': [ 173 'channel_transport', 174 'test_support_main', 175 '<(DEPTH)/testing/gmock.gyp:gmock', 176 '<(DEPTH)/testing/gtest.gyp:gtest', 177 ], 178 'sources': [ 179 'channel_transport/udp_transport_unittest.cc', 180 'channel_transport/udp_socket_manager_unittest.cc', 181 'channel_transport/udp_socket_wrapper_unittest.cc', 182 'testsupport/unittest_utils.h', 183 'testsupport/fileutils_unittest.cc', 184 'testsupport/frame_reader_unittest.cc', 185 'testsupport/frame_writer_unittest.cc', 186 'testsupport/packet_reader_unittest.cc', 187 'testsupport/perf_test_unittest.cc', 188 ], 189 # Disable warnings to enable Win64 build, issue 1323. 190 'msvs_disabled_warnings': [ 191 4267, # size_t to int truncation. 192 ], 193 'conditions': [ 194 # TODO(henrike): remove build_with_chromium==1 when the bots are 195 # using Chromium's buildbots. 196 ['build_with_chromium==1 and OS=="android"', { 197 'dependencies': [ 198 '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code', 199 ], 200 }], 201 ], 202 }, 203 ], 204 'conditions': [ 205 ['build_with_chromium==0', { 206 'targets': [ 207 { 208 'target_name': 'buildbot_tests_scripts', 209 'type': 'none', 210 'copies': [ 211 { 212 'destination': '<(PRODUCT_DIR)', 213 'files': [ 214 'buildbot_tests.py', 215 '<(webrtc_root)/tools/e2e_quality/audio/run_audio_test.py', 216 ], 217 }, 218 { 219 'destination': '<(PRODUCT_DIR)/perf', 220 'files': [ 221 '<(DEPTH)/tools/perf/__init__.py', 222 '<(DEPTH)/tools/perf/perf_utils.py', 223 ], 224 }, 225 ], 226 }, # target buildbot_tests_scripts 227 ], 228 }], 229 # TODO(henrike): remove build_with_chromium==1 when the bots are using 230 # Chromium's buildbots. 231 ['include_tests==1 and build_with_chromium==1 and OS=="android"', { 232 'targets': [ 233 { 234 'target_name': 'test_support_unittests_apk_target', 235 'type': 'none', 236 'dependencies': [ 237 '<(apk_tests_path):test_support_unittests_apk', 238 ], 239 }, 240 ], 241 }], 242 ['test_isolation_mode != "noop"', { 243 'targets': [ 244 { 245 'target_name': 'test_support_unittests_run', 246 'type': 'none', 247 'dependencies': [ 248 'test_support_unittests', 249 ], 250 'includes': [ 251 '../build/isolate.gypi', 252 'test_support_unittests.isolate', 253 ], 254 'sources': [ 255 'test_support_unittests.isolate', 256 ], 257 }, 258 ], 259 }], 260 ], 261 } 262