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 # TODO(ronghuawu): Use gtest.gyp from chromium. 33 'target_name': 'gunit', 34 'type': 'static_library', 35 'sources': [ 36 '<(DEPTH)/testing/gtest/src/gtest-all.cc', 37 ], 38 'include_dirs': [ 39 '<(DEPTH)/testing/gtest/include', 40 '<(DEPTH)/testing/gtest', 41 ], 42 'direct_dependent_settings': { 43 'include_dirs': [ 44 '<(DEPTH)/testing/gtest/include', 45 ], 46 }, 47 'conditions': [ 48 ['OS=="android"', { 49 'include_dirs': [ 50 '<(android_ndk_include)', 51 ] 52 }], 53 ], 54 }, # target gunit 55 { 56 'target_name': 'libjingle_unittest_main', 57 'type': 'static_library', 58 'dependencies': [ 59 '<(DEPTH)/third_party/libyuv/libyuv.gyp:libyuv', 60 'gunit', 61 ], 62 'direct_dependent_settings': { 63 'include_dirs': [ 64 '<(DEPTH)/third_party/libyuv/include', 65 ], 66 }, 67 'sources': [ 68 'base/unittest_main.cc', 69 # Also use this as a convenient dumping ground for misc files that are 70 # included by multiple targets below. 71 'base/fakecpumonitor.h', 72 'base/fakenetwork.h', 73 'base/fakesslidentity.h', 74 'base/faketaskrunner.h', 75 'base/gunit.h', 76 'base/testbase64.h', 77 'base/testechoserver.h', 78 'base/win32toolhelp.h', 79 'media/base/fakecapturemanager.h', 80 'media/base/fakemediaengine.h', 81 'media/base/fakemediaprocessor.h', 82 'media/base/fakenetworkinterface.h', 83 'media/base/fakertp.h', 84 'media/base/fakevideocapturer.h', 85 'media/base/fakevideorenderer.h', 86 'media/base/nullvideoframe.h', 87 'media/base/nullvideorenderer.h', 88 'media/base/testutils.cc', 89 'media/base/testutils.h', 90 'media/devices/fakedevicemanager.h', 91 'media/webrtc/fakewebrtccommon.h', 92 'media/webrtc/fakewebrtcdeviceinfo.h', 93 'media/webrtc/fakewebrtcvcmfactory.h', 94 'media/webrtc/fakewebrtcvideocapturemodule.h', 95 'media/webrtc/fakewebrtcvideoengine.h', 96 'media/webrtc/fakewebrtcvoiceengine.h', 97 ], 98 }, # target libjingle_unittest_main 99 { 100 'target_name': 'libjingle_unittest', 101 'type': 'executable', 102 'dependencies': [ 103 'gunit', 104 'libjingle.gyp:libjingle', 105 'libjingle_unittest_main', 106 ], 107 'sources': [ 108 'base/asynchttprequest_unittest.cc', 109 'base/atomicops_unittest.cc', 110 'base/autodetectproxy_unittest.cc', 111 'base/bandwidthsmoother_unittest.cc', 112 'base/base64_unittest.cc', 113 'base/basictypes_unittest.cc', 114 'base/bind_unittest.cc', 115 'base/buffer_unittest.cc', 116 'base/bytebuffer_unittest.cc', 117 'base/byteorder_unittest.cc', 118 'base/cpumonitor_unittest.cc', 119 'base/crc32_unittest.cc', 120 'base/event_unittest.cc', 121 'base/filelock_unittest.cc', 122 'base/fileutils_unittest.cc', 123 'base/helpers_unittest.cc', 124 'base/httpbase_unittest.cc', 125 'base/httpcommon_unittest.cc', 126 'base/httpserver_unittest.cc', 127 'base/ipaddress_unittest.cc', 128 'base/logging_unittest.cc', 129 'base/md5digest_unittest.cc', 130 'base/messagedigest_unittest.cc', 131 'base/messagequeue_unittest.cc', 132 'base/multipart_unittest.cc', 133 'base/nat_unittest.cc', 134 'base/network_unittest.cc', 135 'base/nullsocketserver_unittest.cc', 136 'base/optionsfile_unittest.cc', 137 'base/pathutils_unittest.cc', 138 'base/physicalsocketserver_unittest.cc', 139 'base/profiler_unittest.cc', 140 'base/proxy_unittest.cc', 141 'base/proxydetect_unittest.cc', 142 'base/ratelimiter_unittest.cc', 143 'base/ratetracker_unittest.cc', 144 'base/referencecountedsingletonfactory_unittest.cc', 145 'base/rollingaccumulator_unittest.cc', 146 'base/sha1digest_unittest.cc', 147 'base/sharedexclusivelock_unittest.cc', 148 'base/signalthread_unittest.cc', 149 'base/sigslot_unittest.cc', 150 'base/socket_unittest.cc', 151 'base/socket_unittest.h', 152 'base/socketaddress_unittest.cc', 153 'base/stream_unittest.cc', 154 'base/stringencode_unittest.cc', 155 'base/stringutils_unittest.cc', 156 # TODO(ronghuawu): Reenable this test. 157 # 'base/systeminfo_unittest.cc', 158 'base/task_unittest.cc', 159 'base/testclient_unittest.cc', 160 'base/thread_unittest.cc', 161 'base/timeutils_unittest.cc', 162 'base/urlencode_unittest.cc', 163 'base/versionparsing_unittest.cc', 164 'base/virtualsocket_unittest.cc', 165 # TODO(ronghuawu): Reenable this test. 166 # 'base/windowpicker_unittest.cc', 167 'xmllite/qname_unittest.cc', 168 'xmllite/xmlbuilder_unittest.cc', 169 'xmllite/xmlelement_unittest.cc', 170 'xmllite/xmlnsstack_unittest.cc', 171 'xmllite/xmlparser_unittest.cc', 172 'xmllite/xmlprinter_unittest.cc', 173 'xmpp/fakexmppclient.h', 174 'xmpp/hangoutpubsubclient_unittest.cc', 175 'xmpp/jid_unittest.cc', 176 'xmpp/mucroomconfigtask_unittest.cc', 177 'xmpp/mucroomdiscoverytask_unittest.cc', 178 'xmpp/mucroomlookuptask_unittest.cc', 179 'xmpp/mucroomuniquehangoutidtask_unittest.cc', 180 'xmpp/pingtask_unittest.cc', 181 'xmpp/pubsubclient_unittest.cc', 182 'xmpp/pubsubtasks_unittest.cc', 183 'xmpp/util_unittest.cc', 184 'xmpp/util_unittest.h', 185 'xmpp/xmppengine_unittest.cc', 186 'xmpp/xmpplogintask_unittest.cc', 187 'xmpp/xmppstanzaparser_unittest.cc', 188 ], # sources 189 'conditions': [ 190 ['OS=="linux"', { 191 'sources': [ 192 'base/latebindingsymboltable_unittest.cc', 193 # TODO(ronghuawu): Reenable this test. 194 # 'base/linux_unittest.cc', 195 'base/linuxfdwalk_unittest.cc', 196 ], 197 }], 198 ['OS=="win"', { 199 'sources': [ 200 'base/win32_unittest.cc', 201 'base/win32regkey_unittest.cc', 202 'base/win32socketserver_unittest.cc', 203 'base/win32toolhelp_unittest.cc', 204 'base/win32window_unittest.cc', 205 'base/win32windowpicker_unittest.cc', 206 'base/winfirewall_unittest.cc', 207 ], 208 'sources!': [ 209 # TODO(ronghuawu): Fix TestUdpReadyToSendIPv6 on windows bot 210 # then reenable these tests. 211 'base/physicalsocketserver_unittest.cc', 212 'base/socket_unittest.cc', 213 'base/win32socketserver_unittest.cc', 214 'base/win32windowpicker_unittest.cc', 215 ], 216 }], 217 ['OS=="mac"', { 218 'sources': [ 219 'base/macsocketserver_unittest.cc', 220 'base/macutils_unittest.cc', 221 'base/macwindowpicker_unittest.cc', 222 ], 223 }], 224 ['os_posix==1', { 225 'sources': [ 226 'base/sslidentity_unittest.cc', 227 'base/sslstreamadapter_unittest.cc', 228 ], 229 }], 230 ], # conditions 231 }, # target libjingle_unittest 232 { 233 'target_name': 'libjingle_sound_unittest', 234 'type': 'executable', 235 'dependencies': [ 236 'gunit', 237 'libjingle.gyp:libjingle_sound', 238 'libjingle_unittest_main', 239 ], 240 'sources': [ 241 'sound/automaticallychosensoundsystem_unittest.cc', 242 ], 243 }, # target libjingle_sound_unittest 244 { 245 'target_name': 'libjingle_media_unittest', 246 'type': 'executable', 247 'dependencies': [ 248 'gunit', 249 'libjingle.gyp:libjingle_media', 250 'libjingle_unittest_main', 251 ], 252 # TODO(ronghuawu): Avoid the copies. 253 # https://code.google.com/p/libjingle/issues/detail?id=398 254 'copies': [ 255 { 256 'destination': '<(DEPTH)/../talk/media/testdata', 257 'files': [ 258 'media/testdata/1.frame_plus_1.byte', 259 'media/testdata/captured-320x240-2s-48.frames', 260 'media/testdata/h264-svc-99-640x360.rtpdump', 261 'media/testdata/video.rtpdump', 262 'media/testdata/voice.rtpdump', 263 ], 264 }, 265 ], 266 'sources': [ 267 # TODO(ronghuawu): Reenable this test. 268 # 'media/base/capturemanager_unittest.cc', 269 'media/base/codec_unittest.cc', 270 'media/base/filemediaengine_unittest.cc', 271 'media/base/rtpdataengine_unittest.cc', 272 'media/base/rtpdump_unittest.cc', 273 'media/base/rtputils_unittest.cc', 274 'media/base/testutils.cc', 275 'media/base/testutils.h', 276 'media/base/videocapturer_unittest.cc', 277 'media/base/videocommon_unittest.cc', 278 'media/base/videoengine_unittest.h', 279 'media/devices/dummydevicemanager_unittest.cc', 280 'media/devices/filevideocapturer_unittest.cc', 281 'media/webrtc/webrtcpassthroughrender_unittest.cc', 282 'media/webrtc/webrtcvideocapturer_unittest.cc', 283 # Omitted because depends on non-open-source testdata files. 284 # 'media/base/videoframe_unittest.h', 285 # 'media/webrtc/webrtcvideoframe_unittest.cc', 286 287 # Disabled because some tests fail. 288 # TODO(ronghuawu): Reenable these tests. 289 # 'media/devices/devicemanager_unittest.cc', 290 # 'media/webrtc/webrtcvideoengine_unittest.cc', 291 # 'media/webrtc/webrtcvoiceengine_unittest.cc', 292 ], 293 'conditions': [ 294 ['OS=="win"', { 295 'msvs_settings': { 296 'VCLinkerTool': { 297 'AdditionalDependencies': [ 298 # TODO(ronghuawu): Since we've included strmiids in 299 # libjingle_media target, we shouldn't need this here. 300 # Find out why it doesn't work without this. 301 'strmiids.lib', 302 ], 303 }, 304 }, 305 }], 306 ], 307 }, # target libjingle_media_unittest 308 { 309 'target_name': 'libjingle_p2p_unittest', 310 'type': 'executable', 311 'dependencies': [ 312 '<(DEPTH)/third_party/libsrtp/libsrtp.gyp:libsrtp', 313 'gunit', 314 'libjingle.gyp:libjingle', 315 'libjingle.gyp:libjingle_p2p', 316 'libjingle_unittest_main', 317 ], 318 'include_dirs': [ 319 '<(DEPTH)/third_party/libsrtp/srtp', 320 ], 321 'sources': [ 322 'p2p/base/dtlstransportchannel_unittest.cc', 323 'p2p/base/fakesession.h', 324 'p2p/base/p2ptransportchannel_unittest.cc', 325 'p2p/base/port_unittest.cc', 326 'p2p/base/portallocatorsessionproxy_unittest.cc', 327 'p2p/base/pseudotcp_unittest.cc', 328 'p2p/base/relayport_unittest.cc', 329 'p2p/base/relayserver_unittest.cc', 330 'p2p/base/session_unittest.cc', 331 'p2p/base/stun_unittest.cc', 332 'p2p/base/stunport_unittest.cc', 333 'p2p/base/stunrequest_unittest.cc', 334 'p2p/base/stunserver_unittest.cc', 335 'p2p/base/testrelayserver.h', 336 'p2p/base/teststunserver.h', 337 'p2p/base/testturnserver.h', 338 'p2p/base/transport_unittest.cc', 339 'p2p/base/transportdescriptionfactory_unittest.cc', 340 'p2p/client/connectivitychecker_unittest.cc', 341 'p2p/client/fakeportallocator.h', 342 'p2p/client/portallocator_unittest.cc', 343 'session/media/channel_unittest.cc', 344 'session/media/channelmanager_unittest.cc', 345 'session/media/currentspeakermonitor_unittest.cc', 346 'session/media/mediarecorder_unittest.cc', 347 'session/media/mediamessages_unittest.cc', 348 'session/media/mediasession_unittest.cc', 349 'session/media/mediasessionclient_unittest.cc', 350 'session/media/rtcpmuxfilter_unittest.cc', 351 'session/media/srtpfilter_unittest.cc', 352 'session/media/ssrcmuxfilter_unittest.cc', 353 ], 354 'conditions': [ 355 ['OS=="win"', { 356 'msvs_settings': { 357 'VCLinkerTool': { 358 'AdditionalDependencies': [ 359 'strmiids.lib', 360 ], 361 }, 362 }, 363 }], 364 ], 365 }, # target libjingle_p2p_unittest 366 { 367 'target_name': 'libjingle_peerconnection_unittest', 368 'type': 'executable', 369 'dependencies': [ 370 'gunit', 371 'libjingle.gyp:libjingle', 372 'libjingle.gyp:libjingle_p2p', 373 'libjingle.gyp:libjingle_peerconnection', 374 'libjingle_unittest_main', 375 ], 376 # TODO(ronghuawu): Reenable below unit tests that require gmock. 377 'sources': [ 378 'app/webrtc/datachannel_unittest.cc', 379 'app/webrtc/dtmfsender_unittest.cc', 380 'app/webrtc/jsepsessiondescription_unittest.cc', 381 'app/webrtc/localaudiosource_unittest.cc', 382 'app/webrtc/localvideosource_unittest.cc', 383 # 'app/webrtc/mediastream_unittest.cc', 384 # 'app/webrtc/mediastreamhandler_unittest.cc', 385 'app/webrtc/mediastreamsignaling_unittest.cc', 386 'app/webrtc/peerconnection_unittest.cc', 387 'app/webrtc/peerconnectionfactory_unittest.cc', 388 'app/webrtc/peerconnectioninterface_unittest.cc', 389 # 'app/webrtc/peerconnectionproxy_unittest.cc', 390 'app/webrtc/test/fakeaudiocapturemodule.cc', 391 'app/webrtc/test/fakeaudiocapturemodule.h', 392 'app/webrtc/test/fakeaudiocapturemodule_unittest.cc', 393 'app/webrtc/test/fakeconstraints.h', 394 'app/webrtc/test/fakedtlsidentityservice.h', 395 'app/webrtc/test/fakemediastreamsignaling.h', 396 'app/webrtc/test/fakeperiodicvideocapturer.h', 397 'app/webrtc/test/fakevideotrackrenderer.h', 398 'app/webrtc/test/mockpeerconnectionobservers.h', 399 'app/webrtc/test/testsdpstrings.h', 400 'app/webrtc/videotrack_unittest.cc', 401 'app/webrtc/webrtcsdp_unittest.cc', 402 'app/webrtc/webrtcsession_unittest.cc', 403 ], 404 }, # target libjingle_peerconnection_unittest 405 ], 406 'conditions': [ 407 ['OS=="linux"', { 408 'targets': [ 409 { 410 'target_name': 'libjingle_peerconnection_test_jar', 411 'type': 'none', 412 'actions': [ 413 { 414 'variables': { 415 'java_src_dir': 'app/webrtc/javatests/src', 416 'java_files': [ 417 'app/webrtc/javatests/src/org/webrtc/PeerConnectionTest.java', 418 ], 419 }, 420 'action_name': 'create_jar', 421 'inputs': [ 422 'build/build_jar.sh', 423 '<@(java_files)', 424 '<(PRODUCT_DIR)/libjingle_peerconnection.jar', 425 '<(DEPTH)/third_party/junit/junit-4.11.jar', 426 ], 427 'outputs': [ 428 '<(PRODUCT_DIR)/libjingle_peerconnection_test.jar', 429 ], 430 'action': [ 431 'build/build_jar.sh', '<(java_home)', '<@(_outputs)', 432 '<(INTERMEDIATE_DIR)', 433 '<(java_src_dir):<(PRODUCT_DIR)/libjingle_peerconnection.jar:<(DEPTH)/third_party/junit/junit-4.11.jar', 434 '<@(java_files)' 435 ], 436 }, 437 ], 438 }, 439 { 440 'target_name': 'libjingle_peerconnection_java_unittest', 441 'type': 'none', 442 'actions': [ 443 { 444 'action_name': 'copy libjingle_peerconnection_java_unittest', 445 'inputs': [ 446 'app/webrtc/javatests/libjingle_peerconnection_java_unittest.sh', 447 '<(PRODUCT_DIR)/libjingle_peerconnection_test_jar', 448 '<(DEPTH)/third_party/junit/junit-4.11.jar', 449 ], 450 'outputs': [ 451 '<(PRODUCT_DIR)/libjingle_peerconnection_java_unittest', 452 ], 453 'action': [ 454 'bash', '-c', 455 'rm -f <(PRODUCT_DIR)/libjingle_peerconnection_java_unittest && ' 456 'sed -e "s@GYP_JAVA_HOME@<(java_home)@" ' 457 '< app/webrtc/javatests/libjingle_peerconnection_java_unittest.sh ' 458 '> <(PRODUCT_DIR)/libjingle_peerconnection_java_unittest && ' 459 'cp <(DEPTH)/third_party/junit/junit-4.11.jar <(PRODUCT_DIR) && ' 460 'chmod u+x <(PRODUCT_DIR)/libjingle_peerconnection_java_unittest' 461 ], 462 }, 463 ], 464 }, 465 ], 466 }], 467 ['libjingle_objc == 1', { 468 'targets': [ 469 { 470 'variables': { 471 'infoplist_file': './app/webrtc/objctests/Info.plist', 472 }, 473 'target_name': 'libjingle_peerconnection_objc_test', 474 'type': 'executable', 475 'mac_bundle': 1, 476 'mac_bundle_resources': [ 477 '<(infoplist_file)', 478 ], 479 # The plist is listed above so that it appears in XCode's file list, 480 # but we don't actually want to bundle it. 481 'mac_bundle_resources!': [ 482 '<(infoplist_file)', 483 ], 484 'xcode_settings': { 485 'CLANG_ENABLE_OBJC_ARC': 'YES', 486 'INFOPLIST_FILE': '<(infoplist_file)', 487 }, 488 'dependencies': [ 489 'gunit', 490 'libjingle.gyp:libjingle_peerconnection_objc', 491 ], 492 'FRAMEWORK_SEARCH_PATHS': [ 493 '$(inherited)', 494 '$(SDKROOT)/Developer/Library/Frameworks', 495 '$(DEVELOPER_LIBRARY_DIR)/Frameworks', 496 ], 497 'sources': [ 498 'app/webrtc/objctests/RTCPeerConnectionSyncObserver.h', 499 'app/webrtc/objctests/RTCPeerConnectionSyncObserver.m', 500 'app/webrtc/objctests/RTCPeerConnectionTest.mm', 501 'app/webrtc/objctests/RTCSessionDescriptionSyncObserver.h', 502 'app/webrtc/objctests/RTCSessionDescriptionSyncObserver.m', 503 ], 504 'conditions': [ 505 ['OS=="mac" or OS=="ios"', { 506 'sources': [ 507 # TODO(fischman): figure out if this works for ios or if it 508 # needs a GUI driver. 509 'app/webrtc/objctests/mac/main.mm', 510 ], 511 }], 512 ], 513 }, 514 ], 515 }], 516 ], 517 } 518