From 8d334d387bff826f8a089c3ec45ad1b5bdcec112 Mon Sep 17 00:00:00 2001 From: "phoglund@webrtc.org" Date: Wed, 28 Nov 2012 12:28:06 +0000 Subject: [PATCH] Disabled flaky test on Linux, added disable-on-platform macros, fixed \n's BUG=1155 Review URL: https://webrtc-codereview.appspot.com/972006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3178 4adac7df-926f-26a2-2b94-8c16560cd09d --- .../fixtures/before_initialization_fixture.h | 19 +++++++++++++++++++ .../test/auto_test/standard/file_test.cc | 2 +- .../test/auto_test/standard/network_test.cc | 8 +++++--- .../test/auto_test/standard/rtp_rtcp_test.cc | 2 +- .../test/auto_test/standard/volume_test.cc | 6 ------ 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.h b/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.h index cd1520d06..d9c29d5e5 100644 --- a/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.h +++ b/webrtc/voice_engine/test/auto_test/fixtures/before_initialization_fixture.h @@ -39,6 +39,25 @@ #include "gtest/gtest.h" #include "gmock/gmock.h" +// Helper macros for platform disables. These can be chained. +#ifdef WEBRTC_LINUX +#define DISABLED_ON_LINUX(test) DISABLED_##test +#else +#define DISABLED_ON_LINUX(test) test +#endif + +#ifdef WEBRTC_MAC +#define DISABLED_ON_MAC(test) DISABLED_##test +#else +#define DISABLED_ON_MAC(test) test +#endif + +#ifdef _WIN32 +#define DISABLED_ON_WIN(test) DISABLED_##test +#else +#define DISABLED_ON_WIN(test) test +#endif + // This convenient fixture sets up all voice engine interfaces automatically for // use by testing subclasses. It allocates each interface and releases it once // which means that if a tests allocates additional interfaces from the voice diff --git a/webrtc/voice_engine/test/auto_test/standard/file_test.cc b/webrtc/voice_engine/test/auto_test/standard/file_test.cc index d8e83709a..99380e6da 100644 --- a/webrtc/voice_engine/test/auto_test/standard/file_test.cc +++ b/webrtc/voice_engine/test/auto_test/standard/file_test.cc @@ -27,7 +27,7 @@ class FileTest : public AfterStreamingFixture { TEST_F(FileTest, ManualRecordToFileForThreeSecondsAndPlayback) { if (!FLAGS_include_timing_dependent_tests) { - TEST_LOG("Skipping test - running in slow execution environment.../n"); + TEST_LOG("Skipping test - running in slow execution environment...\n"); return; } diff --git a/webrtc/voice_engine/test/auto_test/standard/network_test.cc b/webrtc/voice_engine/test/auto_test/standard/network_test.cc index 8cc902d17..8bf2d11c9 100644 --- a/webrtc/voice_engine/test/auto_test/standard/network_test.cc +++ b/webrtc/voice_engine/test/auto_test/standard/network_test.cc @@ -143,9 +143,11 @@ TEST_F(NetworkTest, DoesNotCallDeRegisteredObserver) { Sleep(1500); } -TEST_F(NetworkTest, DeadOrAliveObserverSeesAliveMessagesIfEnabled) { +// TODO(phoglund): flaky on Linux +TEST_F(NetworkTest, + DISABLED_ON_LINUX(DeadOrAliveObserverSeesAliveMessagesIfEnabled)) { if (!FLAGS_include_timing_dependent_tests) { - TEST_LOG("Skipping test - running in slow execution environment.../n"); + TEST_LOG("Skipping test - running in slow execution environment...\n"); return; } @@ -165,7 +167,7 @@ TEST_F(NetworkTest, DeadOrAliveObserverSeesAliveMessagesIfEnabled) { TEST_F(NetworkTest, DeadOrAliveObserverSeesDeadMessagesIfEnabled) { if (!FLAGS_include_timing_dependent_tests) { - TEST_LOG("Skipping test - running in slow execution environment.../n"); + TEST_LOG("Skipping test - running in slow execution environment...\n"); return; } diff --git a/webrtc/voice_engine/test/auto_test/standard/rtp_rtcp_test.cc b/webrtc/voice_engine/test/auto_test/standard/rtp_rtcp_test.cc index a1ecf76b7..3549cb366 100644 --- a/webrtc/voice_engine/test/auto_test/standard/rtp_rtcp_test.cc +++ b/webrtc/voice_engine/test/auto_test/standard/rtp_rtcp_test.cc @@ -140,7 +140,7 @@ void RtcpAppHandler::Reset() { TEST_F(RtpRtcpTest, RemoteRtcpCnameHasPropagatedToRemoteSide) { if (!FLAGS_include_timing_dependent_tests) { - TEST_LOG("Skipping test - running in slow execution environment.../n"); + TEST_LOG("Skipping test - running in slow execution environment...\n"); return; } diff --git a/webrtc/voice_engine/test/auto_test/standard/volume_test.cc b/webrtc/voice_engine/test/auto_test/standard/volume_test.cc index fda867da1..89e0052b0 100644 --- a/webrtc/voice_engine/test/auto_test/standard/volume_test.cc +++ b/webrtc/voice_engine/test/auto_test/standard/volume_test.cc @@ -10,12 +10,6 @@ #include "after_streaming_fixture.h" -#ifdef WEBRTC_LINUX -#define DISABLED_ON_LINUX(test) DISABLED_##test -#else -#define DISABLED_ON_LINUX(test) test -#endif - class VolumeTest : public AfterStreamingFixture { };