blob: 92f007bdfc7c01cb6e5b017ceac6e65b7a3f5077 [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 {
pbos@webrtc.org724947b2013-12-11 16:26:16 +000045 '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 {
asapersson@webrtc.org0f2809a2014-02-21 08:14:45 +000056 '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 {
andresp@webrtc.org60015d22014-05-16 09:39:51 +000067 '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 {
andresp@webrtc.orga36ad692014-05-14 12:24:04 +000078 'target_name': 'test_main',
79 'type': 'static_library',
80 'sources': [
81 'test_main.cc',
82 ],
83 'dependencies': [
andresp@webrtc.org60015d22014-05-16 09:39:51 +000084 'field_trial',
85 '<(DEPTH)/testing/gtest.gyp:gtest',
86 '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
asapersson@webrtc.org580d3672014-10-23 12:57:56 +000087 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:metrics_default',
andresp@webrtc.orga36ad692014-05-14 12:24:04 +000088 ],
89 },
90 {
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +000091 'target_name': 'test_support',
92 'type': 'static_library',
93 'dependencies': [
andrew@webrtc.org81cf5e42012-06-27 01:41:54 +000094 '<(DEPTH)/testing/gtest.gyp:gtest',
95 '<(DEPTH)/testing/gmock.gyp:gmock',
andrew@webrtc.orgc1ffd332013-03-22 17:13:23 +000096 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +000097 ],
98 'sources': [
henrike@webrtc.org34773d92013-07-08 14:55:23 +000099 'testsupport/android/root_path_android.cc',
100 'testsupport/android/root_path_android_chromium.cc',
kjellander@webrtc.org7951e812011-10-13 12:24:41 +0000101 'testsupport/fileutils.cc',
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +0000102 'testsupport/fileutils.h',
kjellander@webrtc.org5b97b122011-12-08 07:42:18 +0000103 'testsupport/frame_reader.cc',
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +0000104 'testsupport/frame_reader.h',
kjellander@webrtc.org5b97b122011-12-08 07:42:18 +0000105 'testsupport/frame_writer.cc',
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +0000106 'testsupport/frame_writer.h',
kjellander@webrtc.org51198f12012-02-21 17:53:46 +0000107 'testsupport/gtest_prod_util.h',
phoglund@webrtc.orgd0054682013-01-09 16:53:42 +0000108 'testsupport/gtest_disable.h',
kjellander@webrtc.org5b97b122011-12-08 07:42:18 +0000109 'testsupport/mock/mock_frame_reader.h',
110 'testsupport/mock/mock_frame_writer.h',
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +0000111 'testsupport/packet_reader.cc',
112 'testsupport/packet_reader.h',
113 'testsupport/perf_test.cc',
114 'testsupport/perf_test.h',
andrew@webrtc.orgb87cc852013-03-25 16:23:37 +0000115 'testsupport/trace_to_stderr.cc',
116 'testsupport/trace_to_stderr.h',
kjellander@webrtc.org7951e812011-10-13 12:24:41 +0000117 ],
henrike@webrtc.org34773d92013-07-08 14:55:23 +0000118 'conditions': [
kjellander@webrtc.org76a42572014-09-02 08:40:39 +0000119 ['OS=="android"', {
henrike@webrtc.org34773d92013-07-08 14:55:23 +0000120 'dependencies': [
121 '<(DEPTH)/base/base.gyp:base',
122 ],
123 'sources!': [
124 'testsupport/android/root_path_android.cc',
125 ],
henrike@webrtc.org34773d92013-07-08 14:55:23 +0000126 }, {
127 'sources!': [
128 'testsupport/android/root_path_android_chromium.cc',
129 ],
130 }],
131 ],
kjellander@webrtc.org7951e812011-10-13 12:24:41 +0000132 },
133 {
kjellander@webrtc.org1a8d08a2011-11-03 23:28:47 +0000134 # Depend on this target when you want to have test_support but also the
135 # main method needed for gtest to execute!
136 'target_name': 'test_support_main',
137 'type': 'static_library',
138 'dependencies': [
andresp@webrtc.org60015d22014-05-16 09:39:51 +0000139 'field_trial',
kjellander@webrtc.org1a8d08a2011-11-03 23:28:47 +0000140 'test_support',
andresp@webrtc.org60015d22014-05-16 09:39:51 +0000141 '<(DEPTH)/testing/gmock.gyp:gmock',
142 '<(DEPTH)/testing/gtest.gyp:gtest',
143 '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
asapersson@webrtc.org580d3672014-10-23 12:57:56 +0000144 '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:metrics_default',
kjellander@webrtc.org1a8d08a2011-11-03 23:28:47 +0000145 ],
146 'sources': [
147 'run_all_unittests.cc',
andresp@webrtc.org60015d22014-05-16 09:39:51 +0000148 'test_suite.cc',
149 'test_suite.h',
kjellander@webrtc.org1a8d08a2011-11-03 23:28:47 +0000150 ],
151 },
152 {
phoglund@webrtc.org54e22eb2012-08-08 08:27:46 +0000153 # 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 {
kjellander@webrtc.org7951e812011-10-13 12:24:41 +0000170 'target_name': 'test_support_unittests',
henrike@webrtc.org89c67402013-08-02 16:53:47 +0000171 'type': '<(gtest_target_type)',
kjellander@webrtc.org7951e812011-10-13 12:24:41 +0000172 'dependencies': [
kjellander@webrtc.org6c35e0b2013-06-11 08:29:17 +0000173 'channel_transport',
kjellander@webrtc.org1a8d08a2011-11-03 23:28:47 +0000174 'test_support_main',
kjellander@webrtc.org6c35e0b2013-06-11 08:29:17 +0000175 '<(DEPTH)/testing/gmock.gyp:gmock',
andrew@webrtc.org81cf5e42012-06-27 01:41:54 +0000176 '<(DEPTH)/testing/gtest.gyp:gtest',
kjellander@webrtc.org7951e812011-10-13 12:24:41 +0000177 ],
kjellander@webrtc.org1a8d08a2011-11-03 23:28:47 +0000178 'sources': [
kjellander@webrtc.org6c35e0b2013-06-11 08:29:17 +0000179 'channel_transport/udp_transport_unittest.cc',
180 'channel_transport/udp_socket_manager_unittest.cc',
181 'channel_transport/udp_socket_wrapper_unittest.cc',
kjellander@webrtc.org6f729e82014-09-02 15:13:55 +0000182 'testsupport/always_passing_unittest.cc',
kjellander@webrtc.org5b97b122011-12-08 07:42:18 +0000183 'testsupport/unittest_utils.h',
kjellander@webrtc.org7951e812011-10-13 12:24:41 +0000184 'testsupport/fileutils_unittest.cc',
kjellander@webrtc.org5b97b122011-12-08 07:42:18 +0000185 'testsupport/frame_reader_unittest.cc',
186 'testsupport/frame_writer_unittest.cc',
187 'testsupport/packet_reader_unittest.cc',
andrew@webrtc.org2009f6b2012-11-20 00:20:20 +0000188 'testsupport/perf_test_unittest.cc',
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +0000189 ],
kjellander@webrtc.org6c35e0b2013-06-11 08:29:17 +0000190 # Disable warnings to enable Win64 build, issue 1323.
191 'msvs_disabled_warnings': [
192 4267, # size_t to int truncation.
193 ],
henrike@webrtc.org89c67402013-08-02 16:53:47 +0000194 'conditions': [
kjellander@webrtc.org3bd41562014-09-01 11:06:37 +0000195 ['OS=="android"', {
henrike@webrtc.org89c67402013-08-02 16:53:47 +0000196 'dependencies': [
197 '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
198 ],
199 }],
200 ],
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +0000201 },
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +0000202 ],
henrike@webrtc.org89c67402013-08-02 16:53:47 +0000203 'conditions': [
kjellander@webrtc.org0372b932014-09-03 14:34:46 +0000204 ['include_tests==1 and OS=="android"', {
henrike@webrtc.org89c67402013-08-02 16:53:47 +0000205 'targets': [
206 {
kjellander@webrtc.org0372b932014-09-03 14:34:46 +0000207 'target_name': 'test_support_unittests_apk_target',
henrike@webrtc.org89c67402013-08-02 16:53:47 +0000208 'type': 'none',
209 'dependencies': [
kjellander@webrtc.org0372b932014-09-03 14:34:46 +0000210 '<(apk_tests_path):test_support_unittests_apk',
henrike@webrtc.org89c67402013-08-02 16:53:47 +0000211 ],
212 },
213 ],
214 }],
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000215 ['test_isolation_mode != "noop"', {
216 'targets': [
217 {
218 'target_name': 'test_support_unittests_run',
219 'type': 'none',
220 'dependencies': [
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000221 'test_support_unittests',
222 ],
223 'includes': [
kjellander@webrtc.org2a973172013-10-02 19:31:16 +0000224 '../build/isolate.gypi',
kjellander@webrtc.org33654222013-08-22 07:57:00 +0000225 'test_support_unittests.isolate',
226 ],
227 'sources': [
228 'test_support_unittests.isolate',
229 ],
230 },
231 ],
232 }],
henrike@webrtc.org89c67402013-08-02 16:53:47 +0000233 ],
andrew@webrtc.org19eefdc2011-09-14 17:02:44 +0000234}