Upstream version 11.40.277.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / test / test.gyp
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': 'rtp_test_utils',
57       'type': 'static_library',
58       'sources': [
59         'rtcp_packet_parser.cc',
60         'rtcp_packet_parser.h',
61         'rtp_file_reader.cc',
62         'rtp_file_reader.h',
63       ],
64       'dependencies': [
65         '<(webrtc_root)/modules/modules.gyp:rtp_rtcp',
66       ],
67     },
68     {
69       'target_name': 'field_trial',
70       'type': 'static_library',
71       'sources': [
72         'field_trial.cc',
73         'field_trial.h',
74       ],
75       'dependencies': [
76         '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
77       ],
78     },
79     {
80       'target_name': 'test_main',
81       'type': 'static_library',
82       'sources': [
83         'test_main.cc',
84       ],
85       'dependencies': [
86         'field_trial',
87         '<(DEPTH)/testing/gtest.gyp:gtest',
88         '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
89         '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:metrics_default',
90       ],
91     },
92     {
93       'target_name': 'test_support',
94       'type': 'static_library',
95       'dependencies': [
96         '<(DEPTH)/testing/gtest.gyp:gtest',
97         '<(DEPTH)/testing/gmock.gyp:gmock',
98         '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
99       ],
100       'sources': [
101         'testsupport/fileutils.cc',
102         'testsupport/fileutils.h',
103         'testsupport/frame_reader.cc',
104         'testsupport/frame_reader.h',
105         'testsupport/frame_writer.cc',
106         'testsupport/frame_writer.h',
107         'testsupport/gtest_prod_util.h',
108         'testsupport/gtest_disable.h',
109         'testsupport/mock/mock_frame_reader.h',
110         'testsupport/mock/mock_frame_writer.h',
111         'testsupport/packet_reader.cc',
112         'testsupport/packet_reader.h',
113         'testsupport/perf_test.cc',
114         'testsupport/perf_test.h',
115         'testsupport/trace_to_stderr.cc',
116         'testsupport/trace_to_stderr.h',
117       ],
118     },
119     {
120       # Depend on this target when you want to have test_support but also the
121       # main method needed for gtest to execute!
122       'target_name': 'test_support_main',
123       'type': 'static_library',
124       'dependencies': [
125         'field_trial',
126         'test_support',
127         '<(DEPTH)/testing/gmock.gyp:gmock',
128         '<(DEPTH)/testing/gtest.gyp:gtest',
129         '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
130         '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:metrics_default',
131       ],
132       'sources': [
133         'run_all_unittests.cc',
134         'test_suite.cc',
135         'test_suite.h',
136       ],
137     },
138     {
139       # Depend on this target when you want to have test_support and a special
140       # main for mac which will run your test on a worker thread and consume
141       # events on the main thread. Useful if you want to access a webcam.
142       # This main will provide all the scaffolding and objective-c black magic
143       # for you. All you need to do is to implement a function in the
144       # run_threaded_main_mac.h file (ImplementThisToRunYourTest).
145       'target_name': 'test_support_main_threaded_mac',
146       'type': 'static_library',
147       'dependencies': [
148         'test_support',
149       ],
150       'sources': [
151         'testsupport/mac/run_threaded_main_mac.h',
152         'testsupport/mac/run_threaded_main_mac.mm',
153       ],
154     },
155     {
156       'target_name': 'test_support_unittests',
157       'type': '<(gtest_target_type)',
158       'dependencies': [
159         'channel_transport',
160         'test_support_main',
161         '<(DEPTH)/testing/gmock.gyp:gmock',
162         '<(DEPTH)/testing/gtest.gyp:gtest',
163       ],
164       'sources': [
165         'channel_transport/udp_transport_unittest.cc',
166         'channel_transport/udp_socket_manager_unittest.cc',
167         'channel_transport/udp_socket_wrapper_unittest.cc',
168         'testsupport/always_passing_unittest.cc',
169         'testsupport/unittest_utils.h',
170         'testsupport/fileutils_unittest.cc',
171         'testsupport/frame_reader_unittest.cc',
172         'testsupport/frame_writer_unittest.cc',
173         'testsupport/packet_reader_unittest.cc',
174         'testsupport/perf_test_unittest.cc',
175       ],
176       # Disable warnings to enable Win64 build, issue 1323.
177       'msvs_disabled_warnings': [
178         4267,  # size_t to int truncation.
179       ],
180       'conditions': [
181         ['OS=="android"', {
182           'dependencies': [
183             '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
184           ],
185         }],
186       ],
187     },
188   ],
189   'conditions': [
190     ['include_tests==1 and OS=="android"', {
191       'targets': [
192         {
193           'target_name': 'test_support_unittests_apk_target',
194           'type': 'none',
195           'dependencies': [
196             '<(apk_tests_path):test_support_unittests_apk',
197           ],
198         },
199       ],
200     }],
201     ['test_isolation_mode != "noop"', {
202       'targets': [
203         {
204           'target_name': 'test_support_unittests_run',
205           'type': 'none',
206           'dependencies': [
207             'test_support_unittests',
208           ],
209           'includes': [
210             '../build/isolate.gypi',
211           ],
212           'sources': [
213             'test_support_unittests.isolate',
214           ],
215         },
216       ],
217     }],
218   ],
219 }