Generalized mechanism for excluding gtests on platforms, disabled broken tests on mac.

BUG=1268
TEST=vie_auto_test on mac and linux
TBR=mflodman, kjellander

Review URL: https://webrtc-codereview.appspot.com/1027006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3347 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
phoglund@webrtc.org 2013-01-09 16:53:42 +00:00
parent 2f225cadde
commit d005468e9b
11 changed files with 117 additions and 88 deletions

View File

@ -42,6 +42,7 @@
'testsupport/frame_writer.cc',
'testsupport/frame_writer.h',
'testsupport/gtest_prod_util.h',
'testsupport/gtest_disable.h',
'testsupport/mock/mock_frame_reader.h',
'testsupport/mock/mock_frame_writer.h',
'testsupport/packet_reader.cc',

View File

@ -0,0 +1,39 @@
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef TEST_TESTSUPPORT_INCLUDE_GTEST_DISABLE_H_
#define TEST_TESTSUPPORT_INCLUDE_GTEST_DISABLE_H_
// Helper macros for platform disables. These can be chained. Example use:
// TEST_F(ViEStandardIntegrationTest,
// DISABLED_ON_LINUX(RunsBaseTestWithoutErrors)) { // ...
//
// Or, you can disable a whole test class by wrapping all mentions of the test
// class name inside one of these macros.
//
// The platform #defines we are looking at here are set by the build system.
#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
#endif // TEST_TESTSUPPORT_INCLUDE_GTEST_DISABLE_H_

View File

@ -8,9 +8,9 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "video_engine/test/auto_test/automated/legacy_fixture.h"
#include "webrtc/video_engine/test/auto_test/automated/legacy_fixture.h"
#include "video_engine/test/auto_test/interface/vie_autotest.h"
#include "webrtc/video_engine/test/auto_test/interface/vie_autotest.h"
void LegacyFixture::SetUpTestCase() {
TwoWindowsFixture::SetUpTestCase();

View File

@ -8,10 +8,10 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef SRC_VIDEO_ENGINE_TEST_AUTO_TEST_AUTOMATED_VIE_LEGACY_FIXTURE_H_
#define SRC_VIDEO_ENGINE_TEST_AUTO_TEST_AUTOMATED_VIE_LEGACY_FIXTURE_H_
#ifndef WEBRTC_VIDEO_ENGINE_TEST_AUTO_TEST_AUTOMATED_VIE_LEGACY_FIXTURE_H_
#define WEBRTC_VIDEO_ENGINE_TEST_AUTO_TEST_AUTOMATED_VIE_LEGACY_FIXTURE_H_
#include "video_engine/test/auto_test/automated/two_windows_fixture.h"
#include "webrtc/video_engine/test/auto_test/automated/two_windows_fixture.h"
// Inherited by old-style standard integration tests based on ViEAutoTest.
class LegacyFixture : public TwoWindowsFixture {
@ -26,4 +26,4 @@ class LegacyFixture : public TwoWindowsFixture {
static ViEAutoTest* tests_;
};
#endif // SRC_VIDEO_ENGINE_TEST_AUTO_TEST_AUTOMATED_VIE_LEGACY_FIXTURE_H_
#endif // WEBRTC_VIDEO_ENGINE_TEST_AUTO_TEST_AUTOMATED_VIE_LEGACY_FIXTURE_H_

View File

@ -8,16 +8,16 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "video_engine/test/auto_test/automated/two_windows_fixture.h"
#include "webrtc/video_engine/test/auto_test/automated/two_windows_fixture.h"
#include "video_engine/test/auto_test/interface/vie_window_creator.h"
#include "video_engine/test/auto_test/interface/vie_autotest_window_manager_interface.h"
#include "webrtc/video_engine/test/auto_test/interface/vie_autotest_window_manager_interface.h"
#include "webrtc/video_engine/test/auto_test/interface/vie_window_creator.h"
void TwoWindowsFixture::SetUpTestCase() {
window_creator_ = new ViEWindowCreator();
ViEAutoTestWindowManagerInterface* window_manager =
window_creator_->CreateTwoWindows();
window_creator_->CreateTwoWindows();
window_1_ = window_manager->GetWindow1();
window_2_ = window_manager->GetWindow2();

View File

@ -8,53 +8,55 @@
* be found in the AUTHORS file in the root of the source tree.
*/
/**
* Runs "extended" integration tests.
*/
#include "gtest/gtest.h"
#include "legacy_fixture.h"
#include "vie_autotest.h"
#include "webrtc/test/testsupport/gtest_disable.h"
#include "webrtc/video_engine/test/auto_test/automated/legacy_fixture.h"
#include "webrtc/video_engine/test/auto_test/interface/vie_autotest.h"
namespace {
class ViEApiIntegrationTest : public LegacyFixture {
// TODO(phoglund): These tests are generally broken on mac.
// http://code.google.com/p/webrtc/issues/detail?id=1268
class DISABLED_ON_MAC(ViEApiIntegrationTest) : public LegacyFixture {
};
TEST_F(ViEApiIntegrationTest, RunsBaseTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEApiIntegrationTest), RunsBaseTestWithoutErrors) {
tests_->ViEBaseAPITest();
}
// TODO(phoglund): Crashes on the v4l2loopback camera.
TEST_F(ViEApiIntegrationTest, DISABLED_RunsCaptureTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEApiIntegrationTest),
DISABLED_RunsCaptureTestWithoutErrors) {
tests_->ViECaptureAPITest();
}
TEST_F(ViEApiIntegrationTest, RunsCodecTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEApiIntegrationTest), RunsCodecTestWithoutErrors) {
tests_->ViECodecAPITest();
}
TEST_F(ViEApiIntegrationTest, RunsEncryptionTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEApiIntegrationTest),
RunsEncryptionTestWithoutErrors) {
tests_->ViEEncryptionAPITest();
}
TEST_F(ViEApiIntegrationTest, RunsFileTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEApiIntegrationTest), RunsFileTestWithoutErrors) {
tests_->ViEFileAPITest();
}
TEST_F(ViEApiIntegrationTest, RunsImageProcessTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEApiIntegrationTest),
RunsImageProcessTestWithoutErrors) {
tests_->ViEImageProcessAPITest();
}
TEST_F(ViEApiIntegrationTest, RunsNetworkTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEApiIntegrationTest), RunsNetworkTestWithoutErrors) {
tests_->ViENetworkAPITest();
}
TEST_F(ViEApiIntegrationTest, RunsRenderTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEApiIntegrationTest), RunsRenderTestWithoutErrors) {
tests_->ViERenderAPITest();
}
TEST_F(ViEApiIntegrationTest, RunsRtpRtcpTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEApiIntegrationTest), RunsRtpRtcpTestWithoutErrors) {
tests_->ViERtpRtcpAPITest();
}

View File

@ -8,54 +8,61 @@
* be found in the AUTHORS file in the root of the source tree.
*/
/**
* Runs "extended" integration tests.
*/
#include "gtest/gtest.h"
#include "legacy_fixture.h"
#include "vie_autotest.h"
#include "webrtc/test/testsupport/gtest_disable.h"
#include "webrtc/video_engine/test/auto_test/automated/legacy_fixture.h"
#include "webrtc/video_engine/test/auto_test/interface/vie_autotest.h"
namespace {
class ViEExtendedIntegrationTest : public LegacyFixture {
// TODO(phoglund): These tests are generally broken on mac.
// http://code.google.com/p/webrtc/issues/detail?id=1268
class DISABLED_ON_MAC(ViEExtendedIntegrationTest) : public LegacyFixture {
};
TEST_F(ViEExtendedIntegrationTest, RunsBaseTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEExtendedIntegrationTest), RunsBaseTestWithoutErrors) {
tests_->ViEBaseExtendedTest();
}
// TODO(phoglund): Crashes on the v4l2loopback camera.
TEST_F(ViEExtendedIntegrationTest, DISABLED_RunsCaptureTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEExtendedIntegrationTest),
DISABLED_RunsCaptureTestWithoutErrors) {
tests_->ViECaptureExtendedTest();
}
TEST_F(ViEExtendedIntegrationTest, RunsCodecTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEExtendedIntegrationTest),
RunsCodecTestWithoutErrors) {
tests_->ViECodecExtendedTest();
}
TEST_F(ViEExtendedIntegrationTest, RunsEncryptionTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEExtendedIntegrationTest),
RunsEncryptionTestWithoutErrors) {
tests_->ViEEncryptionExtendedTest();
}
TEST_F(ViEExtendedIntegrationTest, RunsFileTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEExtendedIntegrationTest),
RunsFileTestWithoutErrors) {
tests_->ViEFileExtendedTest();
}
TEST_F(ViEExtendedIntegrationTest, RunsImageProcessTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEExtendedIntegrationTest),
RunsImageProcessTestWithoutErrors) {
tests_->ViEImageProcessExtendedTest();
}
TEST_F(ViEExtendedIntegrationTest, RunsNetworkTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEExtendedIntegrationTest),
RunsNetworkTestWithoutErrors) {
tests_->ViENetworkExtendedTest();
}
TEST_F(ViEExtendedIntegrationTest, RunsRenderTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEExtendedIntegrationTest),
RunsRenderTestWithoutErrors) {
tests_->ViERenderExtendedTest();
}
TEST_F(ViEExtendedIntegrationTest, RunsRtpRtcpTestWithoutErrors) {
TEST_F(DISABLED_ON_MAC(ViEExtendedIntegrationTest),
RunsRtpRtcpTestWithoutErrors) {
tests_->ViERtpRtcpExtendedTest();
}
} // namespace
} // namespace

View File

@ -10,17 +10,17 @@
#include <ctime>
#include "gtest/gtest.h"
#include "gflags/gflags.h"
#include "test/libtest/include/bit_flip_encryption.h"
#include "test/libtest/include/random_encryption.h"
#include "video_engine/test/auto_test/automated/two_windows_fixture.h"
#include "video_engine/test/auto_test/interface/vie_window_creator.h"
#include "video_engine/test/auto_test/interface/vie_autotest_window_manager_interface.h"
#include "video_engine/test/auto_test/primitives/general_primitives.h"
#include "video_engine/test/libvietest/include/tb_capture_device.h"
#include "video_engine/test/libvietest/include/tb_interfaces.h"
#include "video_engine/test/libvietest/include/tb_video_channel.h"
#include "gtest/gtest.h"
#include "webrtc/test/libtest/include/bit_flip_encryption.h"
#include "webrtc/test/libtest/include/random_encryption.h"
#include "webrtc/video_engine/test/auto_test/automated/two_windows_fixture.h"
#include "webrtc/video_engine/test/auto_test/interface/vie_autotest_window_manager_interface.h"
#include "webrtc/video_engine/test/auto_test/interface/vie_window_creator.h"
#include "webrtc/video_engine/test/auto_test/primitives/general_primitives.h"
#include "webrtc/video_engine/test/libvietest/include/tb_capture_device.h"
#include "webrtc/video_engine/test/libvietest/include/tb_interfaces.h"
#include "webrtc/video_engine/test/libvietest/include/tb_video_channel.h"
namespace {
@ -28,7 +28,7 @@ DEFINE_int32(rtp_fuzz_test_rand_seed, 0, "The rand seed to use for "
"the RTP fuzz test. Defaults to time(). 0 cannot be specified.");
class ViERtpFuzzTest : public TwoWindowsFixture {
protected:
protected:
TbVideoChannel* video_channel_;
TbInterfaces* video_engine_;
TbCaptureDevice* capture_device_;

View File

@ -8,24 +8,22 @@
* be found in the AUTHORS file in the root of the source tree.
*/
/*
* This file contains the "standard" suite of integration tests, implemented
* as a GUnit test. This file is a part of the effort to try to automate all
* tests in this section of the code. Currently, this code makes no attempt
* to verify any video output - it only checks for direct errors.
*/
// This file contains the "standard" suite of integration tests, implemented
// as a GUnit test. This file is a part of the effort to try to automate all
// tests in this section of the code. Currently, this code makes no attempt
// to verify any video output - it only checks for direct errors.
#include <cstdio>
#include "gflags/gflags.h"
#include "gtest/gtest.h"
#include "legacy_fixture.h"
#include "testsupport/metrics/video_metrics.h"
#include "vie_autotest.h"
#include "vie_autotest_window_manager_interface.h"
#include "vie_to_file_renderer.h"
#include "vie_window_creator.h"
#include "testsupport/metrics/video_metrics.h"
#include "webrtc/test/testsupport/metrics/video_metrics.h"
#include "webrtc/test/testsupport/metrics/video_metrics.h"
#include "webrtc/video_engine/test/auto_test/automated/legacy_fixture.h"
#include "webrtc/video_engine/test/auto_test/interface/vie_autotest.h"
#include "webrtc/video_engine/test/auto_test/interface/vie_autotest_window_manager_interface.h"
#include "webrtc/video_engine/test/auto_test/interface/vie_window_creator.h"
#include "webrtc/video_engine/test/libvietest/include/vie_to_file_renderer.h"
namespace {

View File

@ -11,8 +11,8 @@
#include <vector>
#include "gtest/gtest.h"
#include "testsupport/fileutils.h"
#include "testsupport/metrics/video_metrics.h"
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc/test/testsupport/metrics/video_metrics.h"
#include "webrtc/video_engine/test/auto_test/interface/vie_autotest.h"
#include "webrtc/video_engine/test/auto_test/interface/vie_file_based_comparison_tests.h"
#include "webrtc/video_engine/test/auto_test/primitives/framedrop_primitives.h"

View File

@ -15,6 +15,7 @@
#include "common_types.h"
#include "engine_configurations.h"
#include "test/testsupport/gtest_disable.h"
#include "voice_engine/include/voe_audio_processing.h"
#include "voice_engine/include/voe_base.h"
#include "voice_engine/include/voe_call_report.h"
@ -39,25 +40,6 @@
#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