Index: webrtc/BUILD.gn |
diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn |
index cdaa78e79d9b144e7811e7dd61b097bed0fb8ee5..0c6db74022a01dea2507a6c066a3a1257ba8c5e7 100644 |
--- a/webrtc/BUILD.gn |
+++ b/webrtc/BUILD.gn |
@@ -11,6 +11,7 @@ |
import("//build/config/linux/pkg_config.gni") |
import("//build/config/sanitizers/sanitizers.gni") |
import("build/webrtc.gni") |
+import("//testing/test.gni") |
import("//third_party/protobuf/proto_library.gni") |
# Contains the defines and includes in common.gypi that are duplicated both as |
@@ -377,3 +378,197 @@ if (use_libfuzzer || use_drfuzz) { |
] |
} |
} |
+ |
+# There's no point processing WebRTC standalone tests in a Chromium build. |
+if (!build_with_chromium) { |
+ config("rtc_unittests_config") { |
+ # GN orders flags on a target before flags from configs. The default config |
+ # adds -Wall, and this flag have to be after -Wall -- so they need to |
+ # come from a config and can"t be on the target directly. |
phoglund
2016/06/03 14:28:56
Nit: ', not "
|
+ if (is_clang) { |
+ cflags = [ |
+ "-Wno-missing-braces", |
+ "-Wno-sign-compare", |
+ "-Wno-unused-const-variable", |
+ ] |
+ } |
+ } |
+ |
+ test("rtc_unittests") { |
+ testonly = true |
+ sources = [ |
+ "base/array_view_unittest.cc", |
+ "base/atomicops_unittest.cc", |
+ "base/autodetectproxy_unittest.cc", |
+ "base/bandwidthsmoother_unittest.cc", |
+ "base/base64_unittest.cc", |
+ "base/basictypes_unittest.cc", |
+ "base/bind_unittest.cc", |
+ "base/bitbuffer_unittest.cc", |
+ "base/buffer_unittest.cc", |
+ "base/bufferqueue_unittest.cc", |
+ "base/bytebuffer_unittest.cc", |
+ "base/byteorder_unittest.cc", |
+ "base/callback_unittest.cc", |
+ "base/copyonwritebuffer_unittest.cc", |
+ "base/crc32_unittest.cc", |
+ "base/criticalsection_unittest.cc", |
+ "base/event_tracer_unittest.cc", |
+ "base/event_unittest.cc", |
+ "base/exp_filter_unittest.cc", |
+ "base/fakeclock.cc", |
+ "base/fakeclock.h", |
+ "base/filerotatingstream_unittest.cc", |
+ "base/fileutils_unittest.cc", |
+ "base/helpers_unittest.cc", |
+ "base/httpbase_unittest.cc", |
+ "base/httpcommon_unittest.cc", |
+ "base/httpserver_unittest.cc", |
+ "base/ipaddress_unittest.cc", |
+ "base/logging_unittest.cc", |
+ "base/md5digest_unittest.cc", |
+ "base/messagedigest_unittest.cc", |
+ "base/messagequeue_unittest.cc", |
+ "base/mod_ops_unittest.cc", |
+ "base/multipart_unittest.cc", |
+ "base/nat_unittest.cc", |
+ "base/network_unittest.cc", |
+ "base/onetimeevent_unittest.cc", |
+ "base/optional_unittest.cc", |
+ "base/optionsfile_unittest.cc", |
+ "base/pathutils_unittest.cc", |
+ "base/platform_thread_unittest.cc", |
+ "base/profiler_unittest.cc", |
+ "base/proxy_unittest.cc", |
+ "base/proxydetect_unittest.cc", |
+ "base/random_unittest.cc", |
+ "base/rate_statistics_unittest.cc", |
+ "base/ratelimiter_unittest.cc", |
+ "base/ratetracker_unittest.cc", |
+ "base/referencecountedsingletonfactory_unittest.cc", |
+ "base/rollingaccumulator_unittest.cc", |
+ "base/rtccertificate_unittest.cc", |
+ "base/rtccertificategenerator_unittest.cc", |
+ "base/scopedptrcollection_unittest.cc", |
+ "base/sha1digest_unittest.cc", |
+ "base/sharedexclusivelock_unittest.cc", |
+ "base/signalthread_unittest.cc", |
+ "base/sigslot_unittest.cc", |
+ "base/sigslottester.h", |
+ "base/sigslottester.h.pump", |
+ "base/stream_unittest.cc", |
+ "base/stringencode_unittest.cc", |
+ "base/stringutils_unittest.cc", |
+ "base/swap_queue_unittest.cc", |
+ |
+ # TODO(ronghuawu): Reenable this test. |
+ # "systeminfo_unittest.cc", |
+ "base/task_queue_unittest.cc", |
+ "base/task_unittest.cc", |
+ "base/testclient_unittest.cc", |
+ "base/thread_checker_unittest.cc", |
+ "base/thread_unittest.cc", |
+ "base/timedelta.h", |
+ "base/timeutils_unittest.cc", |
+ "base/urlencode_unittest.cc", |
+ "base/versionparsing_unittest.cc", |
+ |
+ # TODO(ronghuawu): Reenable this test. |
+ # "windowpicker_unittest.cc", |
+ "p2p/base/dtlstransportchannel_unittest.cc", |
+ "p2p/base/fakeportallocator.h", |
+ "p2p/base/faketransportcontroller.h", |
+ "p2p/base/p2ptransportchannel_unittest.cc", |
+ "p2p/base/port_unittest.cc", |
+ "p2p/base/portallocator_unittest.cc", |
+ "p2p/base/pseudotcp_unittest.cc", |
+ "p2p/base/relayport_unittest.cc", |
+ "p2p/base/relayserver_unittest.cc", |
+ "p2p/base/stun_unittest.cc", |
+ "p2p/base/stunport_unittest.cc", |
+ "p2p/base/stunrequest_unittest.cc", |
+ "p2p/base/stunserver_unittest.cc", |
+ "p2p/base/tcpport_unittest.cc", |
+ "p2p/base/testrelayserver.h", |
+ "p2p/base/teststunserver.h", |
+ "p2p/base/testturnserver.h", |
+ "p2p/base/transport_unittest.cc", |
+ "p2p/base/transportcontroller_unittest.cc", |
+ "p2p/base/transportdescriptionfactory_unittest.cc", |
+ "p2p/base/turnport_unittest.cc", |
+ "p2p/client/basicportallocator_unittest.cc", |
+ "p2p/stunprober/stunprober_unittest.cc", |
+ ] |
+ |
+ if (is_linux) { |
+ sources += [ |
+ "base/latebindingsymboltable_unittest.cc", |
+ |
+ # TODO(ronghuawu): Reenable this test. |
+ # "linux_unittest.cc", |
+ "base/linuxfdwalk_unittest.cc", |
+ ] |
+ } |
+ |
+ if (is_win) { |
+ sources += [ |
+ "base/win32_unittest.cc", |
+ "base/win32regkey_unittest.cc", |
+ "base/win32window_unittest.cc", |
+ "base/win32windowpicker_unittest.cc", |
+ "base/winfirewall_unittest.cc", |
+ ] |
+ } |
+ |
+ if (is_mac) { |
+ sources += [ "base/macutils_unittest.cc" ] |
+ } |
+ |
+ if (is_posix) { |
+ sources += [ |
+ "base/ssladapter_unittest.cc", |
+ "base/sslidentity_unittest.cc", |
+ "base/sslstreamadapter_unittest.cc", |
+ ] |
+ } |
+ if (is_ios || (is_mac && target_cpu != "x86")) { |
+ defines = [ "CARBON_DEPRECATED=YES" ] |
+ } |
+ |
+ if (rtc_use_quic) { |
+ sources += [ |
+ "p2p/quic/quicconnectionhelper_unittest.cc", |
+ "p2p/quic/quicsession_unittest.cc", |
+ "p2p/quic/quictransport_unittest.cc", |
+ "p2p/quic/quictransportchannel_unittest.cc", |
+ "p2p/quic/reliablequicstream_unittest.cc", |
+ ] |
+ } |
+ |
+ configs += [ |
+ ":common_config", |
+ ":rtc_unittests_config", |
+ ] |
+ public_configs = [ ":common_inherited_config" ] |
+ |
+ if (is_clang) { |
+ # Suppress warnings from the Chromium Clang plugin. |
+ # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. |
+ configs -= [ "//build/config/clang:find_bad_constructs" ] |
+ } |
+ |
+ deps = [ |
+ "base:rtc_base", |
+ "base:rtc_base_test_utils", |
+ "base:rtc_task_queue", |
+ "p2p:libstunprober", |
+ "p2p:rtc_p2p", |
+ "//testing/gmock", |
+ "//testing/gtest", |
+ ] |
+ |
+ if (is_android) { |
+ deps += [ "//testing/android/native_test:native_test_support" ] |
+ } |
+ } |
+} |