Make sure VoiceEngine tests only include one test framework.

BUG=
R=henrikg@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4078 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org
2013-05-21 11:25:12 +00:00
parent d2541e81c6
commit 8a025e26db
12 changed files with 53 additions and 34 deletions

View File

@ -13,6 +13,8 @@
#include "voice_engine/include/voe_network.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace webrtc {
class MockVoeConnectionObserver : public VoEConnectionObserver {

View File

@ -31,14 +31,10 @@
#include "voice_engine/include/voe_rtp_rtcp.h"
#include "voice_engine/include/voe_video_sync.h"
#include "voice_engine/include/voe_volume_control.h"
#include "voice_engine/test/auto_test/voe_test_defines.h"
#include "webrtc/voice_engine/test/auto_test/voe_test_common.h"
// TODO(qhogpat): Remove these undefs once the clashing macros are gone.
#undef TEST
#undef ASSERT_TRUE
#undef ASSERT_FALSE
#include "gtest/gtest.h"
#include "gmock/gmock.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
// This convenient fixture sets up all voice engine interfaces automatically for
// use by testing subclasses. It allocates each interface and releases it once

View File

@ -9,7 +9,6 @@
*/
#include "after_streaming_fixture.h"
#include "voe_test_defines.h"
#include "voice_engine_defines.h"
class CodecTest : public AfterStreamingFixture {

View File

@ -10,7 +10,6 @@
#include "after_streaming_fixture.h"
#include "modules/audio_device/include/audio_device.h"
#include "voe_test_defines.h"
class HardwareTest : public AfterStreamingFixture {
};

View File

@ -20,6 +20,7 @@
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
#include "webrtc/test/channel_transport/include/channel_transport.h"
#include "webrtc/voice_engine/test/auto_test/voe_test_defines.h"
using namespace webrtc;
using namespace test;

View File

@ -16,6 +16,7 @@
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc/voice_engine/voice_engine_defines.h"
#include "webrtc/voice_engine/test/auto_test/voe_test_defines.h"
#if defined(_WIN32)
#include <conio.h>

View File

@ -20,6 +20,7 @@
#include "voice_engine/test/auto_test/voe_cpu_test.h"
#include "voice_engine/test/auto_test/voe_extended_test.h"
#include "voice_engine/test/auto_test/voe_stress_test.h"
#include "voice_engine/test/auto_test/voe_test_defines.h"
#include "voice_engine/test/auto_test/voe_unit_test.h"
#include "voice_engine/voice_engine_defines.h"
@ -256,7 +257,7 @@ VoETestManager::VoETestManager()
voe_file_(0),
voe_hardware_(0),
voe_network_(0),
#ifdef _TEST_NETEQ_STATS_
#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
voe_neteq_stats_(NULL),
#endif
voe_rtp_rtcp_(0),
@ -322,7 +323,7 @@ void VoETestManager::GetInterfaces() {
#ifdef _TEST_CALL_REPORT_
voe_call_report_ = VoECallReport::GetInterface(voice_engine_);
#endif
#ifdef _TEST_NETEQ_STATS_
#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
voe_neteq_stats_ = VoENetEqStats::GetInterface(voice_engine_);
#endif
}
@ -389,7 +390,7 @@ int VoETestManager::ReleaseInterfaces() {
voe_call_report_ = NULL;
}
#endif
#ifdef _TEST_NETEQ_STATS_
#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
if (voe_neteq_stats_) {
voe_neteq_stats_->Release();
voe_neteq_stats_ = NULL;

View File

@ -22,7 +22,7 @@
#include "voe_errors.h"
#include "voe_file.h"
#include "voe_rtp_rtcp.h"
#include "voe_test_defines.h"
#include "voe_test_common.h"
#include "voe_test_interface.h"
#ifdef WEBRTC_VOICE_ENGINE_CALL_REPORT_API
#include "voe_call_report.h"
@ -47,7 +47,7 @@
#include "voe_volume_control.h"
#endif
#ifdef _TEST_NETEQ_STATS_
#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
namespace webrtc {
class CriticalSectionWrapper;
class ThreadWrapper;
@ -199,11 +199,10 @@ class VoETestManager {
return voe_call_report_;
}
#ifdef _TEST_NETEQ_STATS_
#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
VoENetEqStats* NetEqStatsPtr() const {
return voe_neteq_stats_;
}
#endif
private:
@ -219,7 +218,7 @@ class VoETestManager {
VoEFile* voe_file_;
VoEHardware* voe_hardware_;
VoENetwork* voe_network_;
#ifdef _TEST_NETEQ_STATS_
#ifdef WEBRTC_VOICE_ENGINE_NETEQ_STATS_API
VoENetEqStats* voe_neteq_stats_;
#endif
VoERTP_RTCP* voe_rtp_rtcp_;

View File

@ -29,6 +29,7 @@
#include "webrtc/system_wrappers/interface/thread_wrapper.h"
#include "webrtc/test/channel_transport/include/channel_transport.h"
#include "webrtc/voice_engine/test/auto_test/voe_standard_test.h"
#include "webrtc/voice_engine/test/auto_test/voe_test_defines.h"
#include "webrtc/voice_engine/voice_engine_defines.h" // defines build macros
using namespace webrtc;

View File

@ -0,0 +1,34 @@
/*
* 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 WEBRTC_VOICE_ENGINE_VOE_TEST_COMMON_H_
#define WEBRTC_VOICE_ENGINE_VOE_TEST_COMMON_H_
#ifdef WEBRTC_ANDROID
#include <android/log.h>
#define ANDROID_LOG_TAG "VoiceEngine Auto Test"
#define TEST_LOG(...) \
__android_log_print(ANDROID_LOG_DEBUG, ANDROID_LOG_TAG, __VA_ARGS__)
#define TEST_LOG_ERROR(...) \
__android_log_print(ANDROID_LOG_ERROR, ANDROID_LOG_TAG, __VA_ARGS__)
#define TEST_LOG_FLUSH
#else
#define TEST_LOG printf
#define TEST_LOG_ERROR printf
#define TEST_LOG_FLUSH fflush(NULL)
#endif
// Read WEBRTC_VOICE_ENGINE_XXX_API compiler flags
#include "webrtc/engine_configurations.h"
// Time in ms to test each packet size for each codec
#define CODEC_TEST_TIME 400
#endif // WEBRTC_VOICE_ENGINE_VOE_TEST_COMMON_H_

View File

@ -11,23 +11,11 @@
#ifndef WEBRTC_VOICE_ENGINE_VOE_TEST_DEFINES_H
#define WEBRTC_VOICE_ENGINE_VOE_TEST_DEFINES_H
#include "webrtc/voice_engine/test/auto_test/voe_test_common.h"
// Read WEBRTC_VOICE_ENGINE_XXX_API compiler flags
#include "engine_configurations.h"
#ifdef WEBRTC_ANDROID
#include <android/log.h>
#define ANDROID_LOG_TAG "VoiceEngine Auto Test"
#define TEST_LOG(...) \
__android_log_print(ANDROID_LOG_DEBUG, ANDROID_LOG_TAG, __VA_ARGS__)
#define TEST_LOG_ERROR(...) \
__android_log_print(ANDROID_LOG_ERROR, ANDROID_LOG_TAG, __VA_ARGS__)
#define TEST_LOG_FLUSH
#else
#define TEST_LOG printf
#define TEST_LOG_ERROR printf
#define TEST_LOG_FLUSH fflush(NULL)
#endif
// Select the tests to execute, list order below is same as they will be
// executed. Note that, all settings below will be overriden by sub-API
// settings in engine_configurations.h.
@ -102,9 +90,6 @@
#define _INSTRUMENTATION_TESTING_
#endif
// Time in ms to test each packet size for each codec
#define CODEC_TEST_TIME 400
#define MARK() TEST_LOG("."); fflush(NULL); // Add test marker
#define ANL() TEST_LOG("\n") // Add New Line
#define AOK() TEST_LOG("[Test is OK]"); fflush(NULL); // Add OK

View File

@ -22,6 +22,7 @@
#include "webrtc/system_wrappers/interface/sleep.h"
#include "webrtc/test/testsupport/fileutils.h"
#include "webrtc/voice_engine/voice_engine_defines.h"
#include "webrtc/voice_engine/test/auto_test/voe_test_defines.h"
#include "webrtc/voice_engine/test/auto_test/fakes/fake_media_process.h"
using namespace webrtc;