Home | History | Annotate | Download | only in talk
      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:rtc_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:rtc_base',
     78         '<(webrtc_root)/base/base_tests.gyp:rtc_base_tests_utils',
     79         '<(webrtc_root)/libjingle/xmllite/xmllite.gyp:rtc_xmllite',
     80         'libjingle.gyp:libjingle',
     81         'libjingle_unittest_main',
     82       ],
     83       'sources': [
     84         'xmpp/fakexmppclient.h',
     85         'xmpp/hangoutpubsubclient_unittest.cc',
     86         'xmpp/jid_unittest.cc',
     87         'xmpp/mucroomconfigtask_unittest.cc',
     88         'xmpp/mucroomdiscoverytask_unittest.cc',
     89         'xmpp/mucroomlookuptask_unittest.cc',
     90         'xmpp/mucroomuniquehangoutidtask_unittest.cc',
     91         'xmpp/pingtask_unittest.cc',
     92         'xmpp/pubsubclient_unittest.cc',
     93         'xmpp/pubsubtasks_unittest.cc',
     94         'xmpp/util_unittest.cc',
     95         'xmpp/util_unittest.h',
     96         'xmpp/xmppengine_unittest.cc',
     97         'xmpp/xmpplogintask_unittest.cc',
     98         'xmpp/xmppstanzaparser_unittest.cc',
     99       ],  # sources
    100     },  # target libjingle_unittest
    101     {
    102       'target_name': 'libjingle_media_unittest',
    103       'type': 'executable',
    104       'dependencies': [
    105         '<(webrtc_root)/base/base_tests.gyp:rtc_base_tests_utils',
    106         'libjingle.gyp:libjingle_media',
    107         'libjingle_unittest_main',
    108       ],
    109       # TODO(ronghuawu): Avoid the copies.
    110       # https://code.google.com/p/libjingle/issues/detail?id=398
    111       'copies': [
    112         {
    113           'destination': '<(DEPTH)/../talk/media/testdata',
    114           'files': [
    115             'media/testdata/1.frame_plus_1.byte',
    116             'media/testdata/captured-320x240-2s-48.frames',
    117             'media/testdata/h264-svc-99-640x360.rtpdump',
    118             'media/testdata/video.rtpdump',
    119             'media/testdata/voice.rtpdump',
    120           ],
    121         },
    122       ],
    123       'sources': [
    124         # TODO(ronghuawu): Reenable this test.
    125         # 'media/base/capturemanager_unittest.cc',
    126         'media/base/codec_unittest.cc',
    127         'media/base/filemediaengine_unittest.cc',
    128         'media/base/rtpdataengine_unittest.cc',
    129         'media/base/rtpdump_unittest.cc',
    130         'media/base/rtputils_unittest.cc',
    131         'media/base/streamparams_unittest.cc',
    132         'media/base/testutils.cc',
    133         'media/base/testutils.h',
    134         'media/base/videoadapter_unittest.cc',
    135         'media/base/videocapturer_unittest.cc',
    136         'media/base/videocommon_unittest.cc',
    137         'media/base/videoengine_unittest.h',
    138         'media/devices/dummydevicemanager_unittest.cc',
    139         'media/devices/filevideocapturer_unittest.cc',
    140         'media/sctp/sctpdataengine_unittest.cc',
    141         'media/webrtc/webrtcpassthroughrender_unittest.cc',
    142         'media/webrtc/webrtcvideocapturer_unittest.cc',
    143         'media/base/videoframe_unittest.h',
    144         'media/webrtc/webrtcvideoframe_unittest.cc',
    145 
    146         # Disabled because some tests fail.
    147         # TODO(ronghuawu): Reenable these tests.
    148         # 'media/devices/devicemanager_unittest.cc',
    149         'media/webrtc/webrtcvideoengine_unittest.cc',
    150         'media/webrtc/webrtcvideoengine2_unittest.cc',
    151         'media/webrtc/webrtcvideoengine2_unittest.h',
    152         'media/webrtc/webrtcvoiceengine_unittest.cc',
    153       ],
    154       'conditions': [
    155         ['OS=="win"', {
    156           'dependencies': [
    157             '<(DEPTH)/net/third_party/nss/ssl.gyp:libssl',
    158             '<(DEPTH)/third_party/nss/nss.gyp:nspr',
    159             '<(DEPTH)/third_party/nss/nss.gyp:nss',
    160           ],
    161           'msvs_settings': {
    162             'VCLinkerTool': {
    163               'AdditionalDependencies': [
    164                 # TODO(ronghuawu): Since we've included strmiids in
    165                 # libjingle_media target, we shouldn't need this here.
    166                 # Find out why it doesn't work without this.
    167                 'strmiids.lib',
    168               ],
    169             },
    170           },
    171         }],
    172         ['OS=="ios"', {
    173           'sources!': [
    174             'media/sctp/sctpdataengine_unittest.cc',
    175           ],
    176         }],
    177       ],
    178     },  # target libjingle_media_unittest
    179     {
    180       'target_name': 'libjingle_p2p_unittest',
    181       'type': 'executable',
    182       'dependencies': [
    183         '<(DEPTH)/third_party/libsrtp/libsrtp.gyp:libsrtp',
    184         '<(webrtc_root)/base/base_tests.gyp:rtc_base_tests_utils',
    185         'libjingle.gyp:libjingle',
    186         'libjingle.gyp:libjingle_p2p',
    187         'libjingle_unittest_main',
    188       ],
    189       'include_dirs': [
    190         '<(DEPTH)/third_party/libsrtp/srtp',
    191       ],
    192       'sources': [
    193         'p2p/base/dtlstransportchannel_unittest.cc',
    194         'p2p/base/fakesession.h',
    195         'p2p/base/p2ptransportchannel_unittest.cc',
    196         'p2p/base/port_unittest.cc',
    197         'p2p/base/portallocatorsessionproxy_unittest.cc',
    198         'p2p/base/pseudotcp_unittest.cc',
    199         'p2p/base/relayport_unittest.cc',
    200         'p2p/base/relayserver_unittest.cc',
    201         'p2p/base/session_unittest.cc',
    202         'p2p/base/stun_unittest.cc',
    203         'p2p/base/stunport_unittest.cc',
    204         'p2p/base/stunrequest_unittest.cc',
    205         'p2p/base/stunserver_unittest.cc',
    206         'p2p/base/testrelayserver.h',
    207         'p2p/base/teststunserver.h',
    208         'p2p/base/testturnserver.h',
    209         'p2p/base/transport_unittest.cc',
    210         'p2p/base/transportdescriptionfactory_unittest.cc',
    211         'p2p/base/turnport_unittest.cc',
    212         'p2p/client/connectivitychecker_unittest.cc',
    213         'p2p/client/fakeportallocator.h',
    214         'p2p/client/portallocator_unittest.cc',
    215         'session/media/bundlefilter_unittest.cc',
    216         'session/media/channel_unittest.cc',
    217         'session/media/channelmanager_unittest.cc',
    218         'session/media/currentspeakermonitor_unittest.cc',
    219         'session/media/mediarecorder_unittest.cc',
    220         'session/media/mediamessages_unittest.cc',
    221         'session/media/mediasession_unittest.cc',
    222         'session/media/mediasessionclient_unittest.cc',
    223         'session/media/rtcpmuxfilter_unittest.cc',
    224         'session/media/srtpfilter_unittest.cc',
    225       ],
    226       'conditions': [
    227         ['OS=="win"', {
    228           'msvs_settings': {
    229             'VCLinkerTool': {
    230               'AdditionalDependencies': [
    231                 'strmiids.lib',
    232               ],
    233             },
    234           },
    235         }],
    236       ],
    237     },  # target libjingle_p2p_unittest
    238     {
    239       'target_name': 'libjingle_peerconnection_unittest',
    240       'type': 'executable',
    241       'dependencies': [
    242         '<(DEPTH)/testing/gmock.gyp:gmock',
    243         '<(webrtc_root)/base/base_tests.gyp:rtc_base_tests_utils',
    244         'libjingle.gyp:libjingle',
    245         'libjingle.gyp:libjingle_p2p',
    246         'libjingle.gyp:libjingle_peerconnection',
    247         'libjingle_unittest_main',
    248       ],
    249       'direct_dependent_settings': {
    250         'include_dirs': [
    251           '<(DEPTH)/testing/gmock/include',
    252         ],
    253       },
    254       'sources': [
    255         'app/webrtc/datachannel_unittest.cc',
    256         'app/webrtc/dtmfsender_unittest.cc',
    257         'app/webrtc/jsepsessiondescription_unittest.cc',
    258         'app/webrtc/localaudiosource_unittest.cc',
    259         'app/webrtc/mediastream_unittest.cc',
    260         'app/webrtc/mediastreamhandler_unittest.cc',
    261         'app/webrtc/mediastreamsignaling_unittest.cc',
    262         'app/webrtc/peerconnection_unittest.cc',
    263         'app/webrtc/peerconnectionendtoend_unittest.cc',
    264         'app/webrtc/peerconnectionfactory_unittest.cc',
    265         'app/webrtc/peerconnectioninterface_unittest.cc',
    266         # 'app/webrtc/peerconnectionproxy_unittest.cc',
    267         'app/webrtc/remotevideocapturer_unittest.cc',
    268         'app/webrtc/sctputils.cc',
    269         'app/webrtc/statscollector_unittest.cc',
    270         'app/webrtc/test/fakeaudiocapturemodule.cc',
    271         'app/webrtc/test/fakeaudiocapturemodule.h',
    272         'app/webrtc/test/fakeaudiocapturemodule_unittest.cc',
    273         'app/webrtc/test/fakeconstraints.h',
    274         'app/webrtc/test/fakedatachannelprovider.h',
    275         'app/webrtc/test/fakedtlsidentityservice.h',
    276         'app/webrtc/test/fakemediastreamsignaling.h',
    277         'app/webrtc/test/fakeperiodicvideocapturer.h',
    278         'app/webrtc/test/fakevideotrackrenderer.h',
    279         'app/webrtc/test/mockpeerconnectionobservers.h',
    280         'app/webrtc/test/peerconnectiontestwrapper.h',
    281         'app/webrtc/test/peerconnectiontestwrapper.cc',
    282         'app/webrtc/test/testsdpstrings.h',
    283         'app/webrtc/videosource_unittest.cc',
    284         'app/webrtc/videotrack_unittest.cc',
    285         'app/webrtc/webrtcsdp_unittest.cc',
    286         'app/webrtc/webrtcsession_unittest.cc',
    287       ],
    288       'conditions': [
    289         ['OS=="android"', {
    290           # We want gmock features that use tr1::tuple, but we currently
    291           # don't support the variadic templates used by libstdc++'s
    292           # implementation. gmock supports this scenario by providing its
    293           # own implementation but we must opt in to it.
    294           'defines': [
    295             'GTEST_USE_OWN_TR1_TUPLE=1',
    296             # GTEST_USE_OWN_TR1_TUPLE only works if GTEST_HAS_TR1_TUPLE is set.
    297             # gmock r625 made it so that GTEST_HAS_TR1_TUPLE is set to 0
    298             # automatically on android, so it has to be set explicitly here.
    299             'GTEST_HAS_TR1_TUPLE=1',
    300            ],
    301         }],
    302       ],
    303     },  # target libjingle_peerconnection_unittest
    304   ],
    305   'conditions': [
    306     ['OS=="linux"', {
    307       'targets': [
    308         {
    309           'target_name': 'libjingle_peerconnection_test_jar',
    310           'type': 'none',
    311           'actions': [
    312             {
    313               'variables': {
    314                 'java_src_dir': 'app/webrtc/javatests/src',
    315                 'java_files': [
    316                   'app/webrtc/javatests/src/org/webrtc/PeerConnectionTest.java',
    317                 ],
    318               },
    319               'action_name': 'create_jar',
    320               'inputs': [
    321                 'build/build_jar.sh',
    322                 '<@(java_files)',
    323                 '<(PRODUCT_DIR)/libjingle_peerconnection.jar',
    324                 '<(DEPTH)/third_party/junit/junit-4.11.jar',
    325               ],
    326               'outputs': [
    327                 '<(PRODUCT_DIR)/libjingle_peerconnection_test.jar',
    328               ],
    329               'action': [
    330                 'build/build_jar.sh', '<(java_home)', '<@(_outputs)',
    331                 '<(INTERMEDIATE_DIR)',
    332                 '<(java_src_dir):<(PRODUCT_DIR)/libjingle_peerconnection.jar:<(DEPTH)/third_party/junit/junit-4.11.jar',
    333                 '<@(java_files)'
    334               ],
    335             },
    336           ],
    337         },
    338         {
    339           'target_name': 'libjingle_peerconnection_java_unittest',
    340           'type': 'none',
    341           'actions': [
    342             {
    343               'action_name': 'copy libjingle_peerconnection_java_unittest',
    344               'inputs': [
    345                 'app/webrtc/javatests/libjingle_peerconnection_java_unittest.sh',
    346                 '<(PRODUCT_DIR)/libjingle_peerconnection_test_jar',
    347                 '<(DEPTH)/third_party/junit/junit-4.11.jar',
    348               ],
    349               'outputs': [
    350                 '<(PRODUCT_DIR)/libjingle_peerconnection_java_unittest',
    351               ],
    352               'action': [
    353                 'bash', '-c',
    354                 'rm -f <(PRODUCT_DIR)/libjingle_peerconnection_java_unittest && '
    355                 'sed -e "s@GYP_JAVA_HOME@<(java_home)@" '
    356                 '< app/webrtc/javatests/libjingle_peerconnection_java_unittest.sh '
    357                 '> <(PRODUCT_DIR)/libjingle_peerconnection_java_unittest && '
    358                 'cp <(DEPTH)/third_party/junit/junit-4.11.jar <(PRODUCT_DIR) && '
    359                 'chmod u+x <(PRODUCT_DIR)/libjingle_peerconnection_java_unittest'
    360               ],
    361             },
    362           ],
    363         },
    364       ],
    365     }],
    366     ['OS=="ios" or (OS=="mac" and target_arch!="ia32" and mac_sdk>="10.7")', {
    367       # The >=10.7 above is required to make ARC link cleanly (e.g. as
    368       # opposed to _compile_ cleanly, which the library under test
    369       # does just fine on 10.6 too).
    370       'targets': [
    371         {
    372           'target_name': 'libjingle_peerconnection_objc_test',
    373           'type': 'executable',
    374           'includes': [ 'build/ios_tests.gypi', ],
    375           'dependencies': [
    376             '<(webrtc_root)/base/base_tests.gyp:rtc_base_tests_utils',
    377             'libjingle.gyp:libjingle_peerconnection_objc',
    378           ],
    379           'sources': [
    380             'app/webrtc/objctests/RTCPeerConnectionSyncObserver.h',
    381             'app/webrtc/objctests/RTCPeerConnectionSyncObserver.m',
    382             'app/webrtc/objctests/RTCPeerConnectionTest.mm',
    383             'app/webrtc/objctests/RTCSessionDescriptionSyncObserver.h',
    384             'app/webrtc/objctests/RTCSessionDescriptionSyncObserver.m',
    385             # TODO(fischman): figure out if this works for ios or if it
    386             # needs a GUI driver.
    387             'app/webrtc/objctests/mac/main.mm',
    388           ],
    389           'FRAMEWORK_SEARCH_PATHS': [
    390             '$(inherited)',
    391             '$(SDKROOT)/Developer/Library/Frameworks',
    392             '$(DEVELOPER_LIBRARY_DIR)/Frameworks',
    393           ],
    394 
    395           # TODO(fischman): there is duplication here with
    396           # build/ios_tests.gypi, because for historical reasons the
    397           # mac x64 bots expect this unittest to be in a bundle
    398           # directory (.app).  Once the bots don't expect this
    399           # anymore, remove this duplication.
    400           'variables': {
    401             'infoplist_file': 'build/ios_test.plist',
    402           },
    403           'mac_bundle': 1,
    404           'mac_bundle_resources': [
    405             '<(infoplist_file)',
    406           ],
    407           # The plist is listed above so that it appears in XCode's file list,
    408           # but we don't actually want to bundle it.
    409           'mac_bundle_resources!': [
    410             '<(infoplist_file)',
    411           ],
    412           'xcode_settings': {
    413             'CLANG_ENABLE_OBJC_ARC': 'YES',
    414             # common.gypi enables this for mac but we want this to be disabled
    415             # like it is for ios.
    416             'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
    417             'INFOPLIST_FILE': '<(infoplist_file)',
    418           },
    419           'conditions': [
    420             ['OS=="mac"', {
    421               'xcode_settings': {
    422                 # Need to build against 10.7 framework for full ARC support
    423                 # on OSX.
    424                 'MACOSX_DEPLOYMENT_TARGET' : '10.7',
    425               },
    426             }],
    427           ],
    428         },  # target libjingle_peerconnection_objc_test
    429       ],
    430     }],
    431     ['test_isolation_mode != "noop"', {
    432       'targets': [
    433         {
    434           'target_name': 'libjingle_media_unittest_run',
    435           'type': 'none',
    436           'dependencies': [
    437             'libjingle_media_unittest',
    438           ],
    439           'includes': [
    440             'build/isolate.gypi',
    441             'libjingle_media_unittest.isolate',
    442           ],
    443           'sources': [
    444             'libjingle_media_unittest.isolate',
    445           ],
    446         },
    447         {
    448           'target_name': 'libjingle_p2p_unittest_run',
    449           'type': 'none',
    450           'dependencies': [
    451             'libjingle_p2p_unittest',
    452           ],
    453           'includes': [
    454             'build/isolate.gypi',
    455             'libjingle_p2p_unittest.isolate',
    456           ],
    457           'sources': [
    458             'libjingle_p2p_unittest.isolate',
    459           ],
    460         },
    461         {
    462           'target_name': 'libjingle_peerconnection_unittest_run',
    463           'type': 'none',
    464           'dependencies': [
    465             'libjingle_peerconnection_unittest',
    466           ],
    467           'includes': [
    468             'build/isolate.gypi',
    469             'libjingle_peerconnection_unittest.isolate',
    470           ],
    471           'sources': [
    472             'libjingle_peerconnection_unittest.isolate',
    473           ],
    474         },
    475         {
    476           'target_name': 'libjingle_unittest_run',
    477           'type': 'none',
    478           'dependencies': [
    479             'libjingle_unittest',
    480           ],
    481           'includes': [
    482             'build/isolate.gypi',
    483             'libjingle_unittest.isolate',
    484           ],
    485           'sources': [
    486             'libjingle_unittest.isolate',
    487           ],
    488         },
    489       ],
    490     }],
    491   ],
    492 }
    493