Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / libjingle / source / talk / libjingle_tests.gyp
1 #
2 # libjingle
3 # Copyright 2012, Google Inc.
4 #
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are met:
7 #
8 #  1. Redistributions of source code must retain the above copyright notice,
9 #     this list of conditions and the following disclaimer.
10 #  2. Redistributions in binary form must reproduce the above copyright notice,
11 #     this list of conditions and the following disclaimer in the documentation
12 #     and/or other materials provided with the distribution.
13 #  3. The name of the author may not be used to endorse or promote products
14 #     derived from this software without specific prior written permission.
15 #
16 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19 # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 #
27
28 {
29   'includes': ['build/common.gypi'],
30   'targets': [
31     {
32       'target_name': 'libjingle_unittest_main',
33       'type': 'static_library',
34       'dependencies': [
35         '<(DEPTH)/third_party/libyuv/libyuv.gyp:libyuv',
36         '<(webrtc_root)/base/base_tests.gyp:webrtc_base_tests_utils',
37         '<@(libjingle_tests_additional_deps)',
38       ],
39       'direct_dependent_settings': {
40         'include_dirs': [
41           '<(DEPTH)/third_party/libyuv/include',
42           '<(DEPTH)/testing/gtest/include',
43           '<(DEPTH)/testing/gtest',
44         ],
45       },
46       'include_dirs': [
47          '<(DEPTH)/testing/gtest/include',
48          '<(DEPTH)/testing/gtest',
49        ],
50       'sources': [
51         'media/base/fakecapturemanager.h',
52         'media/base/fakemediaengine.h',
53         'media/base/fakemediaprocessor.h',
54         'media/base/fakenetworkinterface.h',
55         'media/base/fakertp.h',
56         'media/base/fakevideocapturer.h',
57         'media/base/fakevideorenderer.h',
58         'media/base/nullvideoframe.h',
59         'media/base/nullvideorenderer.h',
60         'media/base/testutils.cc',
61         'media/base/testutils.h',
62         'media/devices/fakedevicemanager.h',
63         'media/webrtc/dummyinstantiation.cc',
64         'media/webrtc/fakewebrtccommon.h',
65         'media/webrtc/fakewebrtcdeviceinfo.h',
66         'media/webrtc/fakewebrtcvcmfactory.h',
67         'media/webrtc/fakewebrtcvideocapturemodule.h',
68         'media/webrtc/fakewebrtcvideoengine.h',
69         'media/webrtc/fakewebrtcvoiceengine.h',
70       ],
71     },  # target libjingle_unittest_main
72     {
73       'target_name': 'libjingle_unittest',
74       'type': 'executable',
75       'includes': [ 'build/ios_tests.gypi', ],
76       'dependencies': [
77         '<(webrtc_root)/base/base.gyp:webrtc_base',
78         '<(webrtc_root)/base/base_tests.gyp:webrtc_base_tests_utils',
79         'libjingle.gyp:libjingle',
80         'libjingle_unittest_main',
81       ],
82       'sources': [
83         'xmllite/qname_unittest.cc',
84         'xmllite/xmlbuilder_unittest.cc',
85         'xmllite/xmlelement_unittest.cc',
86         'xmllite/xmlnsstack_unittest.cc',
87         'xmllite/xmlparser_unittest.cc',
88         'xmllite/xmlprinter_unittest.cc',
89         'xmpp/fakexmppclient.h',
90         'xmpp/hangoutpubsubclient_unittest.cc',
91         'xmpp/jid_unittest.cc',
92         'xmpp/mucroomconfigtask_unittest.cc',
93         'xmpp/mucroomdiscoverytask_unittest.cc',
94         'xmpp/mucroomlookuptask_unittest.cc',
95         'xmpp/mucroomuniquehangoutidtask_unittest.cc',
96         'xmpp/pingtask_unittest.cc',
97         'xmpp/pubsubclient_unittest.cc',
98         'xmpp/pubsubtasks_unittest.cc',
99         'xmpp/util_unittest.cc',
100         'xmpp/util_unittest.h',
101         'xmpp/xmppengine_unittest.cc',
102         'xmpp/xmpplogintask_unittest.cc',
103         'xmpp/xmppstanzaparser_unittest.cc',
104       ],  # sources
105     },  # target libjingle_unittest
106     {
107       'target_name': 'libjingle_sound_unittest',
108       'type': 'executable',
109       'dependencies': [
110         '<(webrtc_root)/base/base_tests.gyp:webrtc_base_tests_utils',
111         'libjingle.gyp:libjingle_sound',
112         'libjingle_unittest_main',
113       ],
114       'sources': [
115         'sound/automaticallychosensoundsystem_unittest.cc',
116       ],
117     },  # target libjingle_sound_unittest
118     {
119       'target_name': 'libjingle_media_unittest',
120       'type': 'executable',
121       'dependencies': [
122         '<(webrtc_root)/base/base_tests.gyp:webrtc_base_tests_utils',
123         'libjingle.gyp:libjingle_media',
124         'libjingle_unittest_main',
125       ],
126       # TODO(ronghuawu): Avoid the copies.
127       # https://code.google.com/p/libjingle/issues/detail?id=398
128       'copies': [
129         {
130           'destination': '<(DEPTH)/../talk/media/testdata',
131           'files': [
132             'media/testdata/1.frame_plus_1.byte',
133             'media/testdata/captured-320x240-2s-48.frames',
134             'media/testdata/h264-svc-99-640x360.rtpdump',
135             'media/testdata/video.rtpdump',
136             'media/testdata/voice.rtpdump',
137           ],
138         },
139       ],
140       'sources': [
141         # TODO(ronghuawu): Reenable this test.
142         # 'media/base/capturemanager_unittest.cc',
143         'media/base/codec_unittest.cc',
144         'media/base/filemediaengine_unittest.cc',
145         'media/base/rtpdataengine_unittest.cc',
146         'media/base/rtpdump_unittest.cc',
147         'media/base/rtputils_unittest.cc',
148         'media/base/streamparams_unittest.cc',
149         'media/base/testutils.cc',
150         'media/base/testutils.h',
151         'media/base/videoadapter_unittest.cc',
152         'media/base/videocapturer_unittest.cc',
153         'media/base/videocommon_unittest.cc',
154         'media/base/videoengine_unittest.h',
155         'media/devices/dummydevicemanager_unittest.cc',
156         'media/devices/filevideocapturer_unittest.cc',
157         'media/sctp/sctpdataengine_unittest.cc',
158         'media/webrtc/webrtcpassthroughrender_unittest.cc',
159         'media/webrtc/webrtcvideocapturer_unittest.cc',
160         # Omitted because depends on non-open-source testdata files.
161         # 'media/base/videoframe_unittest.h',
162         # 'media/webrtc/webrtcvideoframe_unittest.cc',
163
164         # Disabled because some tests fail.
165         # TODO(ronghuawu): Reenable these tests.
166         # 'media/devices/devicemanager_unittest.cc',
167         'media/webrtc/webrtcvideoengine_unittest.cc',
168         'media/webrtc/webrtcvideoengine2_unittest.cc',
169         'media/webrtc/webrtcvideoengine2_unittest.h',
170         'media/webrtc/webrtcvoiceengine_unittest.cc',
171       ],
172       'conditions': [
173         ['OS=="win"', {
174           'msvs_settings': {
175             'VCLinkerTool': {
176               'AdditionalDependencies': [
177                 # TODO(ronghuawu): Since we've included strmiids in
178                 # libjingle_media target, we shouldn't need this here.
179                 # Find out why it doesn't work without this.
180                 'strmiids.lib',
181               ],
182             },
183           },
184         }],
185         ['OS=="ios"', {
186           'sources!': [
187             'media/sctp/sctpdataengine_unittest.cc',
188           ],
189         }],
190       ],
191     },  # target libjingle_media_unittest
192     {
193       'target_name': 'libjingle_p2p_unittest',
194       'type': 'executable',
195       'dependencies': [
196         '<(DEPTH)/third_party/libsrtp/libsrtp.gyp:libsrtp',
197         '<(webrtc_root)/base/base_tests.gyp:webrtc_base_tests_utils',
198         'libjingle.gyp:libjingle',
199         'libjingle.gyp:libjingle_p2p',
200         'libjingle_unittest_main',
201       ],
202       'include_dirs': [
203         '<(DEPTH)/third_party/libsrtp/srtp',
204       ],
205       'sources': [
206         'p2p/base/dtlstransportchannel_unittest.cc',
207         'p2p/base/fakesession.h',
208         'p2p/base/p2ptransportchannel_unittest.cc',
209         'p2p/base/port_unittest.cc',
210         'p2p/base/portallocatorsessionproxy_unittest.cc',
211         'p2p/base/pseudotcp_unittest.cc',
212         'p2p/base/relayport_unittest.cc',
213         'p2p/base/relayserver_unittest.cc',
214         'p2p/base/session_unittest.cc',
215         'p2p/base/stun_unittest.cc',
216         'p2p/base/stunport_unittest.cc',
217         'p2p/base/stunrequest_unittest.cc',
218         'p2p/base/stunserver_unittest.cc',
219         'p2p/base/testrelayserver.h',
220         'p2p/base/teststunserver.h',
221         'p2p/base/testturnserver.h',
222         'p2p/base/transport_unittest.cc',
223         'p2p/base/transportdescriptionfactory_unittest.cc',
224         'p2p/base/turnport_unittest.cc',
225         'p2p/client/connectivitychecker_unittest.cc',
226         'p2p/client/fakeportallocator.h',
227         'p2p/client/portallocator_unittest.cc',
228         'session/media/bundlefilter_unittest.cc',
229         'session/media/channel_unittest.cc',
230         'session/media/channelmanager_unittest.cc',
231         'session/media/currentspeakermonitor_unittest.cc',
232         'session/media/mediarecorder_unittest.cc',
233         'session/media/mediamessages_unittest.cc',
234         'session/media/mediasession_unittest.cc',
235         'session/media/mediasessionclient_unittest.cc',
236         'session/media/rtcpmuxfilter_unittest.cc',
237         'session/media/srtpfilter_unittest.cc',
238       ],
239       'conditions': [
240         ['OS=="win"', {
241           'msvs_settings': {
242             'VCLinkerTool': {
243               'AdditionalDependencies': [
244                 'strmiids.lib',
245               ],
246             },
247           },
248         }],
249       ],
250     },  # target libjingle_p2p_unittest
251     {
252       'target_name': 'libjingle_peerconnection_unittest',
253       'type': 'executable',
254       'dependencies': [
255         '<(DEPTH)/testing/gmock.gyp:gmock',
256         '<(webrtc_root)/base/base_tests.gyp:webrtc_base_tests_utils',
257         'libjingle.gyp:libjingle',
258         'libjingle.gyp:libjingle_p2p',
259         'libjingle.gyp:libjingle_peerconnection',
260         'libjingle_unittest_main',
261       ],
262       'direct_dependent_settings': {
263         'include_dirs': [
264           '<(DEPTH)/testing/gmock/include',
265         ],
266       },
267       'sources': [
268         'app/webrtc/datachannel_unittest.cc',
269         'app/webrtc/dtmfsender_unittest.cc',
270         'app/webrtc/jsepsessiondescription_unittest.cc',
271         'app/webrtc/localaudiosource_unittest.cc',
272         'app/webrtc/mediastream_unittest.cc',
273         'app/webrtc/mediastreamhandler_unittest.cc',
274         'app/webrtc/mediastreamsignaling_unittest.cc',
275         'app/webrtc/peerconnection_unittest.cc',
276         'app/webrtc/peerconnectionendtoend_unittest.cc',
277         'app/webrtc/peerconnectionfactory_unittest.cc',
278         'app/webrtc/peerconnectioninterface_unittest.cc',
279         # 'app/webrtc/peerconnectionproxy_unittest.cc',
280         'app/webrtc/remotevideocapturer_unittest.cc',
281         'app/webrtc/sctputils.cc',
282         'app/webrtc/statscollector_unittest.cc',
283         'app/webrtc/test/fakeaudiocapturemodule.cc',
284         'app/webrtc/test/fakeaudiocapturemodule.h',
285         'app/webrtc/test/fakeaudiocapturemodule_unittest.cc',
286         'app/webrtc/test/fakeconstraints.h',
287         'app/webrtc/test/fakedatachannelprovider.h',
288         'app/webrtc/test/fakedtlsidentityservice.h',
289         'app/webrtc/test/fakemediastreamsignaling.h',
290         'app/webrtc/test/fakeperiodicvideocapturer.h',
291         'app/webrtc/test/fakevideotrackrenderer.h',
292         'app/webrtc/test/mockpeerconnectionobservers.h',
293         'app/webrtc/test/peerconnectiontestwrapper.h',
294         'app/webrtc/test/peerconnectiontestwrapper.cc',
295         'app/webrtc/test/testsdpstrings.h',
296         'app/webrtc/videosource_unittest.cc',
297         'app/webrtc/videotrack_unittest.cc',
298         'app/webrtc/webrtcsdp_unittest.cc',
299         'app/webrtc/webrtcsession_unittest.cc',
300       ],
301       'conditions': [
302         ['OS=="android"', {
303           # We want gmock features that use tr1::tuple, but we currently
304           # don't support the variadic templates used by libstdc++'s
305           # implementation. gmock supports this scenario by providing its
306           # own implementation but we must opt in to it.
307           'defines': [
308             'GTEST_USE_OWN_TR1_TUPLE=1',
309             # GTEST_USE_OWN_TR1_TUPLE only works if GTEST_HAS_TR1_TUPLE is set.
310             # gmock r625 made it so that GTEST_HAS_TR1_TUPLE is set to 0
311             # automatically on android, so it has to be set explicitly here.
312             'GTEST_HAS_TR1_TUPLE=1',
313            ],
314         }],
315       ],
316     },  # target libjingle_peerconnection_unittest
317   ],
318   'conditions': [
319     ['OS=="linux"', {
320       'targets': [
321         {
322           'target_name': 'libjingle_peerconnection_test_jar',
323           'type': 'none',
324           'actions': [
325             {
326               'variables': {
327                 'java_src_dir': 'app/webrtc/javatests/src',
328                 'java_files': [
329                   'app/webrtc/javatests/src/org/webrtc/PeerConnectionTest.java',
330                 ],
331               },
332               'action_name': 'create_jar',
333               'inputs': [
334                 'build/build_jar.sh',
335                 '<@(java_files)',
336                 '<(PRODUCT_DIR)/libjingle_peerconnection.jar',
337                 '<(DEPTH)/third_party/junit/junit-4.11.jar',
338               ],
339               'outputs': [
340                 '<(PRODUCT_DIR)/libjingle_peerconnection_test.jar',
341               ],
342               'action': [
343                 'build/build_jar.sh', '<(java_home)', '<@(_outputs)',
344                 '<(INTERMEDIATE_DIR)',
345                 '<(java_src_dir):<(PRODUCT_DIR)/libjingle_peerconnection.jar:<(DEPTH)/third_party/junit/junit-4.11.jar',
346                 '<@(java_files)'
347               ],
348             },
349           ],
350         },
351         {
352           'target_name': 'libjingle_peerconnection_java_unittest',
353           'type': 'none',
354           'actions': [
355             {
356               'action_name': 'copy libjingle_peerconnection_java_unittest',
357               'inputs': [
358                 'app/webrtc/javatests/libjingle_peerconnection_java_unittest.sh',
359                 '<(PRODUCT_DIR)/libjingle_peerconnection_test_jar',
360                 '<(DEPTH)/third_party/junit/junit-4.11.jar',
361               ],
362               'outputs': [
363                 '<(PRODUCT_DIR)/libjingle_peerconnection_java_unittest',
364               ],
365               'action': [
366                 'bash', '-c',
367                 'rm -f <(PRODUCT_DIR)/libjingle_peerconnection_java_unittest && '
368                 'sed -e "s@GYP_JAVA_HOME@<(java_home)@" '
369                 '< app/webrtc/javatests/libjingle_peerconnection_java_unittest.sh '
370                 '> <(PRODUCT_DIR)/libjingle_peerconnection_java_unittest && '
371                 'cp <(DEPTH)/third_party/junit/junit-4.11.jar <(PRODUCT_DIR) && '
372                 'chmod u+x <(PRODUCT_DIR)/libjingle_peerconnection_java_unittest'
373               ],
374             },
375           ],
376         },
377       ],
378     }],
379     ['OS=="ios" or (OS=="mac" and target_arch!="ia32" and mac_sdk>="10.7")', {
380       # The >=10.7 above is required to make ARC link cleanly (e.g. as
381       # opposed to _compile_ cleanly, which the library under test
382       # does just fine on 10.6 too).
383       'targets': [
384         {
385           'target_name': 'libjingle_peerconnection_objc_test',
386           'type': 'executable',
387           'includes': [ 'build/ios_tests.gypi', ],
388           'dependencies': [
389             '<(webrtc_root)/base/base_tests.gyp:webrtc_base_tests_utils',
390             'libjingle.gyp:libjingle_peerconnection_objc',
391           ],
392           'sources': [
393             'app/webrtc/objctests/RTCPeerConnectionSyncObserver.h',
394             'app/webrtc/objctests/RTCPeerConnectionSyncObserver.m',
395             'app/webrtc/objctests/RTCPeerConnectionTest.mm',
396             'app/webrtc/objctests/RTCSessionDescriptionSyncObserver.h',
397             'app/webrtc/objctests/RTCSessionDescriptionSyncObserver.m',
398             # TODO(fischman): figure out if this works for ios or if it
399             # needs a GUI driver.
400             'app/webrtc/objctests/mac/main.mm',
401           ],
402           'FRAMEWORK_SEARCH_PATHS': [
403             '$(inherited)',
404             '$(SDKROOT)/Developer/Library/Frameworks',
405             '$(DEVELOPER_LIBRARY_DIR)/Frameworks',
406           ],
407
408           # TODO(fischman): there is duplication here with
409           # build/ios_tests.gypi, because for historical reasons the
410           # mac x64 bots expect this unittest to be in a bundle
411           # directory (.app).  Once the bots don't expect this
412           # anymore, remove this duplication.
413           'variables': {
414             'infoplist_file': 'build/ios_test.plist',
415           },
416           'mac_bundle': 1,
417           'mac_bundle_resources': [
418             '<(infoplist_file)',
419           ],
420           # The plist is listed above so that it appears in XCode's file list,
421           # but we don't actually want to bundle it.
422           'mac_bundle_resources!': [
423             '<(infoplist_file)',
424           ],
425           'xcode_settings': {
426             'CLANG_ENABLE_OBJC_ARC': 'YES',
427             # common.gypi enables this for mac but we want this to be disabled
428             # like it is for ios.
429             'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
430             'INFOPLIST_FILE': '<(infoplist_file)',
431           },
432           'conditions': [
433             ['OS=="mac"', {
434               'xcode_settings': {
435                 # Need to build against 10.7 framework for full ARC support
436                 # on OSX.
437                 'MACOSX_DEPLOYMENT_TARGET' : '10.7',
438               },
439             }],
440           ],
441         },  # target libjingle_peerconnection_objc_test
442       ],
443     }],
444     ['test_isolation_mode != "noop"', {
445       'targets': [
446         {
447           'target_name': 'libjingle_media_unittest_run',
448           'type': 'none',
449           'dependencies': [
450             'libjingle_media_unittest',
451           ],
452           'includes': [
453             'build/isolate.gypi',
454             'libjingle_media_unittest.isolate',
455           ],
456           'sources': [
457             'libjingle_media_unittest.isolate',
458           ],
459         },
460         {
461           'target_name': 'libjingle_p2p_unittest_run',
462           'type': 'none',
463           'dependencies': [
464             'libjingle_p2p_unittest',
465           ],
466           'includes': [
467             'build/isolate.gypi',
468             'libjingle_p2p_unittest.isolate',
469           ],
470           'sources': [
471             'libjingle_p2p_unittest.isolate',
472           ],
473         },
474         {
475           'target_name': 'libjingle_peerconnection_unittest_run',
476           'type': 'none',
477           'dependencies': [
478             'libjingle_peerconnection_unittest',
479           ],
480           'includes': [
481             'build/isolate.gypi',
482             'libjingle_peerconnection_unittest.isolate',
483           ],
484           'sources': [
485             'libjingle_peerconnection_unittest.isolate',
486           ],
487         },
488         {
489           'target_name': 'libjingle_sound_unittest_run',
490           'type': 'none',
491           'dependencies': [
492             'libjingle_sound_unittest',
493           ],
494           'includes': [
495             'build/isolate.gypi',
496             'libjingle_sound_unittest.isolate',
497           ],
498           'sources': [
499             'libjingle_sound_unittest.isolate',
500           ],
501         },
502         {
503           'target_name': 'libjingle_unittest_run',
504           'type': 'none',
505           'dependencies': [
506             'libjingle_unittest',
507           ],
508           'includes': [
509             'build/isolate.gypi',
510             'libjingle_unittest.isolate',
511           ],
512           'sources': [
513             'libjingle_unittest.isolate',
514           ],
515         },
516       ],
517     }],
518   ],
519 }