blob: d30119b9a768d6b453942c77ea14cb2e6ad3b02f [file] [log] [blame]
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +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': [
andrew@webrtc.org81cf5e42012-06-27 01:41:54 +000012 '../build/common.gypi',
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +000013 ],
14 'targets': [
15 {
kjellander@webrtc.org6c35e0b2013-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.org19eefdc2011-09-14 17:02:44 +000045 'target_name': 'test_support',
46 'type': 'static_library',
47 'dependencies': [
andrew@webrtc.org81cf5e42012-06-27 01:41:54 +000048 '<(DEPTH)/testing/gtest.gyp:gtest',
49 '<(DEPTH)/testing/gmock.gyp:gmock',
andrew@webrtc.orgaa3d1c82013-09-05 21:16:29 +000050 '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
andrew@webrtc.orgc1ffd332013-03-22 17:13:23 +000051 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +000052 ],
53 'sources': [
54 'test_suite.cc',
55 'test_suite.h',
henrike@webrtc.org34773d92013-07-08 14:55:23 +000056 'testsupport/android/root_path_android.cc',
57 'testsupport/android/root_path_android_chromium.cc',
kjellander@webrtc.org7951e812011-10-13 12:24:41 +000058 'testsupport/fileutils.cc',
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +000059 'testsupport/fileutils.h',
kjellander@webrtc.org5b97b122011-12-08 07:42:18 +000060 'testsupport/frame_reader.cc',
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +000061 'testsupport/frame_reader.h',
kjellander@webrtc.org5b97b122011-12-08 07:42:18 +000062 'testsupport/frame_writer.cc',
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +000063 'testsupport/frame_writer.h',
kjellander@webrtc.org51198f12012-02-21 17:53:46 +000064 'testsupport/gtest_prod_util.h',
phoglund@webrtc.orgd0054682013-01-09 16:53:42 +000065 'testsupport/gtest_disable.h',
kjellander@webrtc.org5b97b122011-12-08 07:42:18 +000066 'testsupport/mock/mock_frame_reader.h',
67 'testsupport/mock/mock_frame_writer.h',
andrew@webrtc.org2009f6b2012-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.orgb87cc852013-03-25 16:23:37 +000072 'testsupport/trace_to_stderr.cc',
73 'testsupport/trace_to_stderr.h',
kjellander@webrtc.org7951e812011-10-13 12:24:41 +000074 ],
henrike@webrtc.org34773d92013-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.org5fc4d342013-07-09 02:08:25 +000094 'outputs': ['../../../resources'],
henrike@webrtc.org34773d92013-07-08 14:55:23 +000095 'action': ['python',
96 '<(webrtc_root)/tools/update_resources.py',
henrike@webrtc.org5fc4d342013-07-09 02:08:25 +000097 '-p',
98 '../../../'],
henrike@webrtc.org34773d92013-07-08 14:55:23 +000099 }],
100 }, {
101 'sources!': [
102 'testsupport/android/root_path_android_chromium.cc',
103 ],
104 }],
105 ],
kjellander@webrtc.org7951e812011-10-13 12:24:41 +0000106 },
107 {
kjellander@webrtc.org1a8d08a2011-11-03 23:28:47 +0000108 # 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 {
phoglund@webrtc.org54e22eb2012-08-08 08:27:46 +0000120 # 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 {
kjellander@webrtc.org7951e812011-10-13 12:24:41 +0000137 'target_name': 'test_support_unittests',
henrike@webrtc.org89c67402013-08-02 16:53:47 +0000138 'type': '<(gtest_target_type)',
kjellander@webrtc.org7951e812011-10-13 12:24:41 +0000139 'dependencies': [
kjellander@webrtc.org6c35e0b2013-06-11 08:29:17 +0000140 'channel_transport',
kjellander@webrtc.org1a8d08a2011-11-03 23:28:47 +0000141 'test_support_main',
kjellander@webrtc.org6c35e0b2013-06-11 08:29:17 +0000142 '<(DEPTH)/testing/gmock.gyp:gmock',
andrew@webrtc.org81cf5e42012-06-27 01:41:54 +0000143 '<(DEPTH)/testing/gtest.gyp:gtest',
kjellander@webrtc.org7951e812011-10-13 12:24:41 +0000144 ],
kjellander@webrtc.org1a8d08a2011-11-03 23:28:47 +0000145 'sources': [
kjellander@webrtc.org6c35e0b2013-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',
kjellander@webrtc.org5b97b122011-12-08 07:42:18 +0000149 'testsupport/unittest_utils.h',
kjellander@webrtc.org7951e812011-10-13 12:24:41 +0000150 'testsupport/fileutils_unittest.cc',
kjellander@webrtc.org5b97b122011-12-08 07:42:18 +0000151 'testsupport/frame_reader_unittest.cc',
152 'testsupport/frame_writer_unittest.cc',
153 'testsupport/packet_reader_unittest.cc',
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +0000154 'testsupport/perf_test_unittest.cc',
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +0000155 ],
kjellander@webrtc.org6c35e0b2013-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.org89c67402013-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.org19eefdc2011-09-14 17:02:44 +0000169 },
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +0000170 ],
henrike@webrtc.org89c67402013-08-02 16:53:47 +0000171 'conditions': [
kjellander@webrtc.org5b3b6b12013-10-10 08:48:16 +0000172 ['build_with_chromium==0', {
173 'targets': [
174 {
175 'target_name': 'buildbot_tests_scripts',
176 'type': 'none',
177 'copies': [
178 {
179 'destination': '<(PRODUCT_DIR)',
180 'files': [
181 'buildbot_tests.py',
182 '<(webrtc_root)/tools/e2e_quality/audio/run_audio_test.py',
183 ],
184 },
185 {
186 'destination': '<(PRODUCT_DIR)/perf',
187 'files': [
188 '<(DEPTH)/tools/perf/__init__.py',
189 '<(DEPTH)/tools/perf/perf_utils.py',
190 ],
191 },
192 ],
193 }, # target buildbot_tests_scripts
194 ],
195 }],
henrike@webrtc.org89c67402013-08-02 16:53:47 +0000196 # TODO(henrike): remove build_with_chromium==1 when the bots are using
197 # Chromium's buildbots.
198 ['include_tests==1 and build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
199 'targets': [
200 {
201 'target_name': 'test_support_unittests_apk_target',
202 'type': 'none',
203 'dependencies': [
204 '<(apk_tests_path):test_support_unittests_apk',
205 ],
206 },
207 ],
208 }],
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000209 ['test_isolation_mode != "noop"', {
210 'targets': [
211 {
212 'target_name': 'test_support_unittests_run',
213 'type': 'none',
214 'dependencies': [
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000215 'test_support_unittests',
216 ],
217 'includes': [
kjellander@webrtc.org2a973172013-10-02 19:31:16 +0000218 '../build/isolate.gypi',
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000219 'test_support_unittests.isolate',
220 ],
221 'sources': [
222 'test_support_unittests.isolate',
223 ],
224 },
225 ],
226 }],
henrike@webrtc.org89c67402013-08-02 16:53:47 +0000227 ],
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +0000228}