This allows other tests/tools which don't depend on TestSuite to reuse the functionality. BUG= Review URL: https://webrtc-codereview.appspot.com/1245004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3721 4adac7df-926f-26a2-2b94-8c16560cd09d
47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
/*
|
|
* 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 "webrtc/test/test_suite.h"
|
|
|
|
#include "testing/gmock/include/gmock/gmock.h"
|
|
#include "testing/gtest/include/gtest/gtest.h"
|
|
#include "webrtc/test/testsupport/fileutils.h"
|
|
#include "webrtc/test/testsupport/trace_to_stderr.h"
|
|
|
|
namespace webrtc {
|
|
namespace test {
|
|
|
|
TestSuite::TestSuite(int argc, char** argv)
|
|
: trace_to_stderr_(NULL) {
|
|
SetExecutablePath(argv[0]);
|
|
testing::InitGoogleMock(&argc, argv); // Runs InitGoogleTest() internally.
|
|
}
|
|
|
|
TestSuite::~TestSuite() {
|
|
}
|
|
|
|
int TestSuite::Run() {
|
|
Initialize();
|
|
int result = RUN_ALL_TESTS();
|
|
Shutdown();
|
|
return result;
|
|
}
|
|
|
|
void TestSuite::Initialize() {
|
|
// Create TraceToStderr here so the behavior can be overridden.
|
|
trace_to_stderr_.reset(new TraceToStderr);
|
|
}
|
|
|
|
void TestSuite::Shutdown() {
|
|
}
|
|
|
|
} // namespace test
|
|
} // namespace webrtc
|