Reverting changelist 666 since it broke the build on Mac.

TBR=mflodman
Review URL: http://webrtc-codereview.appspot.com/187003

git-svn-id: http://webrtc.googlecode.com/svn/trunk@673 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
stefan@webrtc.org 2011-10-03 07:37:41 +00:00
parent 6d169f2474
commit f72c36763f
7 changed files with 42 additions and 213 deletions

View File

@ -1,89 +0,0 @@
/*
* Copyright (c) 2011 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.
*/
/*
* 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 "gtest/gtest.h"
#include "vie_autotest.h"
#include "vie_autotest_window_manager_interface.h"
#include "vie_window_creator.h"
namespace {
class ViEStandardIntegrationTest: public testing::Test {
public:
static void SetUpTestCase() {
window_creator_ = new ViEWindowCreator();
ViEAutoTestWindowManagerInterface* window_manager =
window_creator_->CreateTwoWindows();
// Create the test cases
tests_ = new ViEAutoTest(window_manager->GetWindow1(),
window_manager->GetWindow2());
}
static void TearDownTestCase() {
window_creator_->TerminateWindows();
delete tests_;
delete window_creator_;
}
protected:
static ViEWindowCreator* window_creator_;
static ViEAutoTest* tests_;
};
TEST_F(ViEStandardIntegrationTest, RunsBaseStandardTestWithoutErrors) {
ASSERT_EQ(0, tests_->ViEBaseStandardTest());
}
TEST_F(ViEStandardIntegrationTest, RunsCaptureTestWithoutErrors) {
ASSERT_EQ(0, tests_->ViECaptureStandardTest());
}
TEST_F(ViEStandardIntegrationTest, RunsCodecTestWithoutErrors) {
ASSERT_EQ(0, tests_->ViECodecStandardTest());
}
TEST_F(ViEStandardIntegrationTest, RunsEncryptionTestWithoutErrors) {
ASSERT_EQ(0, tests_->ViEEncryptionStandardTest());
}
TEST_F(ViEStandardIntegrationTest, RunsFileTestWithoutErrors) {
ASSERT_EQ(0, tests_->ViEFileStandardTest());
}
TEST_F(ViEStandardIntegrationTest, RunsImageProcessTestWithoutErrors) {
ASSERT_EQ(0, tests_->ViEImageProcessStandardTest());
}
TEST_F(ViEStandardIntegrationTest, RunsNetworkTestWithoutErrors) {
ASSERT_EQ(0, tests_->ViENetworkStandardTest());
}
TEST_F(ViEStandardIntegrationTest, RunsRenderTestWithoutErrors) {
ASSERT_EQ(0, tests_->ViERenderStandardTest());
}
TEST_F(ViEStandardIntegrationTest, RunsRtpRctpTestWithoutErrors) {
ASSERT_EQ(0, tests_->ViERtpRtcpStandardTest());
}
ViEAutoTest* ViEStandardIntegrationTest::tests_ = NULL;
ViEWindowCreator* ViEStandardIntegrationTest::window_creator_ = NULL;
}

View File

@ -1,63 +0,0 @@
/*
* Copyright (c) 2011 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.
*/
#include "vie_window_creator.h"
#include "engine_configurations.h"
#include "vie_autotest_main.h"
#include "vie_codec.h"
#include "voe_codec.h"
#if defined(WIN32)
#include "vie_autotest_windows.h"
#include <tchar.h>
#include <ShellAPI.h> //ShellExecute
#elif defined(WEBRTC_MAC_INTEL)
#if defined(COCOA_RENDERING)
#include "vie_autotest_mac_cocoa.h"
#elif defined(CARBON_RENDERING)
#include "vie_autotest_mac_carbon.h"
#endif
#elif defined(WEBRTC_LINUX)
#include "vie_autotest_linux.h"
#endif
ViEWindowCreator::ViEWindowCreator() {
// Create platform dependent render windows.
window_manager_ = new ViEAutoTestWindowManager();
}
ViEWindowCreator::~ViEWindowCreator() {
delete window_manager_;
}
ViEAutoTestWindowManagerInterface*
ViEWindowCreator::CreateTwoWindows() {
#if (defined(_WIN32))
TCHAR window1Title[1024] = _T("ViE Autotest Window 1");
TCHAR window2Title[1024] = _T("ViE Autotest Window 2");
#else
char window1Title[1024] = "ViE Autotest Window 1";
char window2Title[1024] = "ViE Autotest Window 2";
#endif
AutoTestRect window1Size(352, 288, 600, 100);
AutoTestRect window2Size(352, 288, 1000, 100);
window_manager_->CreateWindows(window1Size, window2Size, window1Title,
window2Title);
window_manager_->SetTopmostWindow();
return window_manager_;
}
void ViEWindowCreator::TerminateWindows() {
window_manager_->TerminateWindows();
}

View File

@ -1,32 +0,0 @@
/*
* Copyright (c) 2011 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 SRC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_HELPERS_VIE_WINDOW_CREATOR_H_
#define SRC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_HELPERS_VIE_WINDOW_CREATOR_H_
class ViEAutoTestWindowManagerInterface;
class ViEWindowCreator {
public:
ViEWindowCreator();
virtual ~ViEWindowCreator();
// The pointer returned here will still be owned by this object.
// Only use it to retrieve the created windows.
ViEAutoTestWindowManagerInterface* CreateTwoWindows();
// Terminates windows opened by CreateTwoWindows, which must
// have been called before this method.
void TerminateWindows();
private:
ViEAutoTestWindowManagerInterface* window_manager_;
};
#endif // SRC_VIDEO_ENGINE_MAIN_TEST_AUTOTEST_HELPERS_VIE_WINDOW_CREATOR_H_

View File

@ -12,9 +12,6 @@
// vie_autotest_linux.cc
//
#include "gtest/gtest.h"
#include <string>
#include "vie_autotest_linux.h"
#include "vie_autotest_defines.h"
@ -147,18 +144,10 @@ bool ViEAutoTestWindowManager::SetTopmostWindow()
return 0;
}
int main(int argc, char** argv)
int main()
{
// This command-line flag is a transitory solution until we
// managed to rewrite all tests to GUnit tests. This flag is
// currently only supported in Linux.
if (argc == 2 && std::string(argv[1]) == "--automated") {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
// Default: run in classic interactive mode.
ViEAutoTestMain autoTest;
autoTest.UseAnswerFile("answers.txt");
return autoTest.BeginOSIndependentTesting();
}

View File

@ -13,11 +13,25 @@
*
*/
#include "vie_window_creator.h"
#include "vie_autotest_window_manager_interface.h"
#include "vie_autotest.h"
#include "vie_autotest_defines.h"
#include "vie_autotest_main.h"
#include "vie_codec.h"
#include "voe_codec.h"
#if defined(WIN32)
#include "vie_autotest_windows.h"
#include <tchar.h>
#include <ShellAPI.h> //ShellExecute
#elif defined(WEBRTC_MAC_INTEL)
#if defined(COCOA_RENDERING)
#include "vie_autotest_mac_cocoa.h"
#elif defined(CARBON_RENDERING)
#include "vie_autotest_mac_carbon.h"
#endif
#elif defined(WEBRTC_LINUX)
#include "vie_autotest_linux.h"
#endif
ViEAutoTestMain::ViEAutoTestMain() :
_answers(),
@ -28,10 +42,23 @@ ViEAutoTestMain::ViEAutoTestMain() :
bool ViEAutoTestMain::BeginOSIndependentTesting()
{
// Create the windows
ViEWindowCreator windowCreator;
// Create platform dependent render windows
ViEAutoTestWindowManagerInterface* windowManager =
windowCreator.CreateTwoWindows();
new ViEAutoTestWindowManager();
#if (defined(_WIN32))
TCHAR window1Title[1024] = _T("ViE Autotest Window 1");
TCHAR window2Title[1024] = _T("ViE Autotest Window 2");
#else
char window1Title[1024] = "ViE Autotest Window 1";
char window2Title[1024] = "ViE Autotest Window 2";
#endif
AutoTestRect window1Size(352, 288, 600, 100);
AutoTestRect window2Size(352, 288, 1000, 100);
windowManager->CreateWindows(window1Size, window2Size, window1Title,
window2Title);
windowManager->SetTopmostWindow();
// Create the test cases
ViEAutoTest vieAutoTest(windowManager->GetWindow1(),
@ -262,7 +289,7 @@ bool ViEAutoTestMain::BeginOSIndependentTesting()
}
} while (testType != 0);
windowCreator.TerminateWindows();
windowManager->TerminateWindows();
if (testErrors)
{
@ -279,6 +306,8 @@ bool ViEAutoTestMain::BeginOSIndependentTesting()
while ((c = getchar()) != '\n' && c != EOF)
/* discard */;
delete windowManager;
return true;
}

View File

@ -230,12 +230,15 @@ int ViEAutoTestWindowManager::ViEDestroyWindow(HWND& hwnd)
bool ViEAutoTestWindowManager::SetTopmostWindow()
{
// Meant to put terminal window on top
// meant to put terminal window on top
return true;
}
int main(int argc, char* argv[])
{
ViEAutoTestMain autoTest;
if (argc > 1)
{

View File

@ -41,12 +41,10 @@
'<(webrtc_root)/modules/modules.gyp:video_render_module',
'<(webrtc_root)/modules/modules.gyp:video_capture_module',
'<(webrtc_root)/voice_engine/voice_engine.gyp:voice_engine_core',
'<(webrtc_root)/../testing/gtest.gyp:gtest',
'video_engine_core',
],
'include_dirs': [
'interface/',
'helpers/',
'../../interface',
'../../source',
'../../../../modules/video_capture/main/source/',
@ -68,12 +66,6 @@
'interface/vie_autotest_window_manager_interface.h',
'interface/vie_autotest_windows.h',
# Helper classes
'helpers/vie_window_creator.cc',
# New, fully automated tests
'automated/vie_standard_integration_test.cc',
# Platform independent
'source/tb_capture_device.cc',
'source/tb_external_transport.cc',