From e9cac751396d140e968192e763f540bd917cb551 Mon Sep 17 00:00:00 2001 From: skvlad Date: Mon, 19 Sep 2016 14:42:02 -0700 Subject: [PATCH] Reenabled the RtcEventLog unittests For some reason the RtcEventLog unit tests were not building and running. This CL adds these tests to the rtc_unittests target. They are only built if protobuf support is enabled. BUG=webrtc:6379 R=stefan@webrtc.org, terelius@webrtc.org Review URL: https://codereview.webrtc.org/2344383002 . Cr-Commit-Position: refs/heads/master@{#14295} --- webrtc/BUILD.gn | 4 ++++ webrtc/call/BUILD.gn | 20 ++++++++++++++++++++ webrtc/call/rtc_event_log_unittest.cc | 5 +---- webrtc/call/rtc_event_log_unittest_helper.cc | 4 ---- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn index b28bef811c..47b757a237 100644 --- a/webrtc/BUILD.gn +++ b/webrtc/BUILD.gn @@ -551,6 +551,10 @@ if (rtc_include_tests) { "//testing/gtest", ] + if (rtc_enable_protobuf) { + deps += [ "call:rtc_event_log_tests" ] + } + if (is_android) { deps += [ "//testing/android/native_test:native_test_support" ] shard_timeout = 900 diff --git a/webrtc/call/BUILD.gn b/webrtc/call/BUILD.gn index 9b2fe9ec2a..05a319210a 100644 --- a/webrtc/call/BUILD.gn +++ b/webrtc/call/BUILD.gn @@ -56,4 +56,24 @@ if (rtc_include_tests) { suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] } } + rtc_source_set("rtc_event_log_tests") { + testonly = true + sources = [ + "rtc_event_log_unittest.cc", + "rtc_event_log_unittest_helper.cc", + ] + deps = [ + "..:rtc_event_log", + "..:rtc_event_log_parser", + "../modules/rtp_rtcp", + "../system_wrappers:metrics_default", + "//testing/gmock", + "//testing/gtest", + ] + if (is_clang) { + # Suppress warnings from the Chromium Clang plugin. + # See http://code.google.com/p/webrtc/issues/detail?id=163 for details. + suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] + } + } } diff --git a/webrtc/call/rtc_event_log_unittest.cc b/webrtc/call/rtc_event_log_unittest.cc index e8f0ccf1c2..34e993cf5c 100644 --- a/webrtc/call/rtc_event_log_unittest.cc +++ b/webrtc/call/rtc_event_log_unittest.cc @@ -8,8 +8,6 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifdef ENABLE_RTC_EVENT_LOG - #include #include #include @@ -459,6 +457,5 @@ TEST(RtcEventLogTest, LogEventAndReadBack) { // Clean up temporary file - can be pretty slow. remove(temp_filename.c_str()); } -} // namespace webrtc -#endif // ENABLE_RTC_EVENT_LOG +} // namespace webrtc diff --git a/webrtc/call/rtc_event_log_unittest_helper.cc b/webrtc/call/rtc_event_log_unittest_helper.cc index 194414f4ba..d7092b8db8 100644 --- a/webrtc/call/rtc_event_log_unittest_helper.cc +++ b/webrtc/call/rtc_event_log_unittest_helper.cc @@ -8,8 +8,6 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifdef ENABLE_RTC_EVENT_LOG - #include "webrtc/call/rtc_event_log_unittest_helper.h" #include @@ -405,5 +403,3 @@ void RtcEventLogTestHelper::VerifyLogEndEvent( } } // namespace webrtc - -#endif // ENABLE_RTC_EVENT_LOG