andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 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 | { |
kjellander@webrtc.org | 46cec2a | 2013-06-11 08:29:17 +0000 | [diff] [blame] | 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 | { |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 45 | 'target_name': 'test_support', |
| 46 | 'type': 'static_library', |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 47 | 'dependencies': [ |
| 48 | '<(DEPTH)/testing/gtest.gyp:gtest', |
| 49 | '<(DEPTH)/testing/gmock.gyp:gmock', |
andrew@webrtc.org | e41c6b2 | 2013-09-05 21:16:29 +0000 | [diff] [blame] | 50 | '<(DEPTH)/third_party/gflags/gflags.gyp:gflags', |
andrew@webrtc.org | 4c27c03 | 2013-03-22 17:13:23 +0000 | [diff] [blame] | 51 | '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers', |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 52 | ], |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 53 | 'sources': [ |
| 54 | 'test_suite.cc', |
| 55 | 'test_suite.h', |
henrike@webrtc.org | e25e28f | 2013-07-08 14:55:23 +0000 | [diff] [blame] | 56 | 'testsupport/android/root_path_android.cc', |
| 57 | 'testsupport/android/root_path_android_chromium.cc', |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 58 | 'testsupport/fileutils.cc', |
andrew@webrtc.org | d064f58 | 2012-11-20 00:20:20 +0000 | [diff] [blame] | 59 | 'testsupport/fileutils.h', |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 60 | 'testsupport/frame_reader.cc', |
andrew@webrtc.org | d064f58 | 2012-11-20 00:20:20 +0000 | [diff] [blame] | 61 | 'testsupport/frame_reader.h', |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 62 | 'testsupport/frame_writer.cc', |
andrew@webrtc.org | d064f58 | 2012-11-20 00:20:20 +0000 | [diff] [blame] | 63 | 'testsupport/frame_writer.h', |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 64 | 'testsupport/gtest_prod_util.h', |
phoglund@webrtc.org | b790741 | 2013-01-09 16:53:42 +0000 | [diff] [blame] | 65 | 'testsupport/gtest_disable.h', |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 66 | 'testsupport/mock/mock_frame_reader.h', |
| 67 | 'testsupport/mock/mock_frame_writer.h', |
andrew@webrtc.org | d064f58 | 2012-11-20 00:20:20 +0000 | [diff] [blame] | 68 | 'testsupport/packet_reader.cc', |
| 69 | 'testsupport/packet_reader.h', |
| 70 | 'testsupport/perf_test.cc', |
| 71 | 'testsupport/perf_test.h', |
andrew@webrtc.org | 8826e34 | 2013-03-25 16:23:37 +0000 | [diff] [blame] | 72 | 'testsupport/trace_to_stderr.cc', |
| 73 | 'testsupport/trace_to_stderr.h', |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 74 | ], |
henrike@webrtc.org | e25e28f | 2013-07-08 14:55:23 +0000 | [diff] [blame] | 75 | 'conditions': [ |
| 76 | # TODO(henrike): remove build_with_chromium==1 when the bots are using |
| 77 | # Chromium's buildbots. |
| 78 | ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', { |
| 79 | 'dependencies': [ |
| 80 | '<(DEPTH)/base/base.gyp:base', |
| 81 | ], |
| 82 | 'sources!': [ |
| 83 | 'testsupport/android/root_path_android.cc', |
| 84 | ], |
| 85 | # WebRTC tests use resource files for testing. These files are not |
| 86 | # hosted in WebRTC. The script ensures that the needed resources |
| 87 | # are downloaded. In stand alone WebRTC the script is called by |
| 88 | # the DEPS file. In Chromium, i.e. here, the files are pulled down |
| 89 | # only if tests requiring the resources are being built. |
| 90 | 'actions': [ |
| 91 | { |
| 92 | 'action_name': 'get_resources', |
| 93 | 'inputs': ['<(webrtc_root)/tools/update_resources.py'], |
henrike@webrtc.org | 609e332 | 2013-07-09 02:08:25 +0000 | [diff] [blame] | 94 | 'outputs': ['../../../resources'], |
henrike@webrtc.org | e25e28f | 2013-07-08 14:55:23 +0000 | [diff] [blame] | 95 | 'action': ['python', |
| 96 | '<(webrtc_root)/tools/update_resources.py', |
henrike@webrtc.org | 609e332 | 2013-07-09 02:08:25 +0000 | [diff] [blame] | 97 | '-p', |
| 98 | '../../../'], |
henrike@webrtc.org | e25e28f | 2013-07-08 14:55:23 +0000 | [diff] [blame] | 99 | }], |
| 100 | }, { |
| 101 | 'sources!': [ |
| 102 | 'testsupport/android/root_path_android_chromium.cc', |
| 103 | ], |
| 104 | }], |
| 105 | ], |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 106 | }, |
| 107 | { |
| 108 | # Depend on this target when you want to have test_support but also the |
| 109 | # main method needed for gtest to execute! |
| 110 | 'target_name': 'test_support_main', |
| 111 | 'type': 'static_library', |
| 112 | 'dependencies': [ |
| 113 | 'test_support', |
| 114 | ], |
| 115 | 'sources': [ |
| 116 | 'run_all_unittests.cc', |
| 117 | ], |
| 118 | }, |
| 119 | { |
| 120 | # Depend on this target when you want to have test_support and a special |
| 121 | # main for mac which will run your test on a worker thread and consume |
| 122 | # events on the main thread. Useful if you want to access a webcam. |
| 123 | # This main will provide all the scaffolding and objective-c black magic |
| 124 | # for you. All you need to do is to implement a function in the |
| 125 | # run_threaded_main_mac.h file (ImplementThisToRunYourTest). |
| 126 | 'target_name': 'test_support_main_threaded_mac', |
| 127 | 'type': 'static_library', |
| 128 | 'dependencies': [ |
| 129 | 'test_support', |
| 130 | ], |
| 131 | 'sources': [ |
| 132 | 'testsupport/mac/run_threaded_main_mac.h', |
| 133 | 'testsupport/mac/run_threaded_main_mac.mm', |
| 134 | ], |
| 135 | }, |
| 136 | { |
| 137 | 'target_name': 'test_support_unittests', |
henrike@webrtc.org | acb00f5 | 2013-08-02 16:53:47 +0000 | [diff] [blame] | 138 | 'type': '<(gtest_target_type)', |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 139 | 'dependencies': [ |
kjellander@webrtc.org | 46cec2a | 2013-06-11 08:29:17 +0000 | [diff] [blame] | 140 | 'channel_transport', |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 141 | 'test_support_main', |
kjellander@webrtc.org | 46cec2a | 2013-06-11 08:29:17 +0000 | [diff] [blame] | 142 | '<(DEPTH)/testing/gmock.gyp:gmock', |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 143 | '<(DEPTH)/testing/gtest.gyp:gtest', |
| 144 | ], |
| 145 | 'sources': [ |
kjellander@webrtc.org | 46cec2a | 2013-06-11 08:29:17 +0000 | [diff] [blame] | 146 | 'channel_transport/udp_transport_unittest.cc', |
| 147 | 'channel_transport/udp_socket_manager_unittest.cc', |
| 148 | 'channel_transport/udp_socket_wrapper_unittest.cc', |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 149 | 'testsupport/unittest_utils.h', |
| 150 | 'testsupport/fileutils_unittest.cc', |
| 151 | 'testsupport/frame_reader_unittest.cc', |
| 152 | 'testsupport/frame_writer_unittest.cc', |
| 153 | 'testsupport/packet_reader_unittest.cc', |
andrew@webrtc.org | d064f58 | 2012-11-20 00:20:20 +0000 | [diff] [blame] | 154 | 'testsupport/perf_test_unittest.cc', |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 155 | ], |
kjellander@webrtc.org | 46cec2a | 2013-06-11 08:29:17 +0000 | [diff] [blame] | 156 | # Disable warnings to enable Win64 build, issue 1323. |
| 157 | 'msvs_disabled_warnings': [ |
| 158 | 4267, # size_t to int truncation. |
| 159 | ], |
henrike@webrtc.org | acb00f5 | 2013-08-02 16:53:47 +0000 | [diff] [blame] | 160 | 'conditions': [ |
| 161 | # TODO(henrike): remove build_with_chromium==1 when the bots are |
| 162 | # using Chromium's buildbots. |
| 163 | ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', { |
| 164 | 'dependencies': [ |
| 165 | '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code', |
| 166 | ], |
| 167 | }], |
| 168 | ], |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 169 | }, |
kjellander@webrtc.org | 58598d6 | 2013-01-25 10:10:53 +0000 | [diff] [blame] | 170 | { |
| 171 | 'target_name': 'buildbot_tests_scripts', |
| 172 | 'type': 'none', |
| 173 | 'copies': [ |
| 174 | { |
| 175 | 'destination': '<(PRODUCT_DIR)', |
| 176 | 'files': [ |
| 177 | 'buildbot_tests.py', |
| 178 | '<(DEPTH)/tools/e2e_quality/audio/run_audio_test.py', |
| 179 | ], |
| 180 | }, |
| 181 | { |
| 182 | 'destination': '<(PRODUCT_DIR)/perf', |
| 183 | 'files': [ |
kjellander@webrtc.org | fcfd6f1 | 2013-01-25 12:18:15 +0000 | [diff] [blame] | 184 | '<(DEPTH)/tools/perf/__init__.py', |
| 185 | '<(DEPTH)/tools/perf/perf_utils.py', |
kjellander@webrtc.org | 58598d6 | 2013-01-25 10:10:53 +0000 | [diff] [blame] | 186 | ], |
| 187 | }, |
| 188 | ], |
| 189 | }, # target buildbot_tests_scripts |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 190 | ], |
henrike@webrtc.org | acb00f5 | 2013-08-02 16:53:47 +0000 | [diff] [blame] | 191 | 'conditions': [ |
| 192 | # TODO(henrike): remove build_with_chromium==1 when the bots are using |
| 193 | # Chromium's buildbots. |
| 194 | ['include_tests==1 and build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', { |
| 195 | 'targets': [ |
| 196 | { |
| 197 | 'target_name': 'test_support_unittests_apk_target', |
| 198 | 'type': 'none', |
| 199 | 'dependencies': [ |
| 200 | '<(apk_tests_path):test_support_unittests_apk', |
| 201 | ], |
| 202 | }, |
| 203 | ], |
| 204 | }], |
kjellander@webrtc.org | 3540c82 | 2013-08-22 07:57:00 +0000 | [diff] [blame] | 205 | ['test_isolation_mode != "noop"', { |
| 206 | 'targets': [ |
| 207 | { |
| 208 | 'target_name': 'test_support_unittests_run', |
| 209 | 'type': 'none', |
| 210 | 'dependencies': [ |
| 211 | '<(import_isolate_path):import_isolate_gypi', |
| 212 | 'test_support_unittests', |
| 213 | ], |
| 214 | 'includes': [ |
| 215 | 'test_support_unittests.isolate', |
| 216 | ], |
| 217 | 'sources': [ |
| 218 | 'test_support_unittests.isolate', |
| 219 | ], |
| 220 | }, |
| 221 | ], |
| 222 | }], |
henrike@webrtc.org | acb00f5 | 2013-08-02 16:53:47 +0000 | [diff] [blame] | 223 | ], |
andrew@webrtc.org | b015cbe | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 224 | } |