blob: 4e01b25d765d7ba692ae0f03779cf9dc6d1896c5 [file] [log] [blame]
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +00001# 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.org46cec2a2013-06-11 08:29:17 +000016 '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.orgb015cbe2012-10-22 18:19:23 +000045 'target_name': 'test_support',
46 'type': 'static_library',
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000047 'dependencies': [
48 '<(DEPTH)/testing/gtest.gyp:gtest',
49 '<(DEPTH)/testing/gmock.gyp:gmock',
andrew@webrtc.orge41c6b22013-09-05 21:16:29 +000050 '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
andrew@webrtc.org4c27c032013-03-22 17:13:23 +000051 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000052 ],
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000053 'sources': [
54 'test_suite.cc',
55 'test_suite.h',
henrike@webrtc.orge25e28f2013-07-08 14:55:23 +000056 'testsupport/android/root_path_android.cc',
57 'testsupport/android/root_path_android_chromium.cc',
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000058 'testsupport/fileutils.cc',
andrew@webrtc.orgd064f582012-11-20 00:20:20 +000059 'testsupport/fileutils.h',
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000060 'testsupport/frame_reader.cc',
andrew@webrtc.orgd064f582012-11-20 00:20:20 +000061 'testsupport/frame_reader.h',
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000062 'testsupport/frame_writer.cc',
andrew@webrtc.orgd064f582012-11-20 00:20:20 +000063 'testsupport/frame_writer.h',
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000064 'testsupport/gtest_prod_util.h',
phoglund@webrtc.orgb7907412013-01-09 16:53:42 +000065 'testsupport/gtest_disable.h',
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000066 'testsupport/mock/mock_frame_reader.h',
67 'testsupport/mock/mock_frame_writer.h',
andrew@webrtc.orgd064f582012-11-20 00:20:20 +000068 'testsupport/packet_reader.cc',
69 'testsupport/packet_reader.h',
70 'testsupport/perf_test.cc',
71 'testsupport/perf_test.h',
andrew@webrtc.org8826e342013-03-25 16:23:37 +000072 'testsupport/trace_to_stderr.cc',
73 'testsupport/trace_to_stderr.h',
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +000074 ],
henrike@webrtc.orge25e28f2013-07-08 14:55:23 +000075 '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.org609e3322013-07-09 02:08:25 +000094 'outputs': ['../../../resources'],
henrike@webrtc.orge25e28f2013-07-08 14:55:23 +000095 'action': ['python',
96 '<(webrtc_root)/tools/update_resources.py',
henrike@webrtc.org609e3322013-07-09 02:08:25 +000097 '-p',
98 '../../../'],
henrike@webrtc.orge25e28f2013-07-08 14:55:23 +000099 }],
100 }, {
101 'sources!': [
102 'testsupport/android/root_path_android_chromium.cc',
103 ],
104 }],
105 ],
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +0000106 },
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.orgacb00f52013-08-02 16:53:47 +0000138 'type': '<(gtest_target_type)',
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +0000139 'dependencies': [
kjellander@webrtc.org46cec2a2013-06-11 08:29:17 +0000140 'channel_transport',
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +0000141 'test_support_main',
kjellander@webrtc.org46cec2a2013-06-11 08:29:17 +0000142 '<(DEPTH)/testing/gmock.gyp:gmock',
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +0000143 '<(DEPTH)/testing/gtest.gyp:gtest',
144 ],
145 'sources': [
kjellander@webrtc.org46cec2a2013-06-11 08:29:17 +0000146 'channel_transport/udp_transport_unittest.cc',
147 'channel_transport/udp_socket_manager_unittest.cc',
148 'channel_transport/udp_socket_wrapper_unittest.cc',
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +0000149 '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.orgd064f582012-11-20 00:20:20 +0000154 'testsupport/perf_test_unittest.cc',
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +0000155 ],
kjellander@webrtc.org46cec2a2013-06-11 08:29:17 +0000156 # Disable warnings to enable Win64 build, issue 1323.
157 'msvs_disabled_warnings': [
158 4267, # size_t to int truncation.
159 ],
henrike@webrtc.orgacb00f52013-08-02 16:53:47 +0000160 '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.orgb015cbe2012-10-22 18:19:23 +0000169 },
kjellander@webrtc.org58598d62013-01-25 10:10:53 +0000170 {
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.orgfcfd6f12013-01-25 12:18:15 +0000184 '<(DEPTH)/tools/perf/__init__.py',
185 '<(DEPTH)/tools/perf/perf_utils.py',
kjellander@webrtc.org58598d62013-01-25 10:10:53 +0000186 ],
187 },
188 ],
189 }, # target buildbot_tests_scripts
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +0000190 ],
henrike@webrtc.orgacb00f52013-08-02 16:53:47 +0000191 '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.org3540c822013-08-22 07:57:00 +0000205 ['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.orgacb00f52013-08-02 16:53:47 +0000223 ],
andrew@webrtc.orgb015cbe2012-10-22 18:19:23 +0000224}