webrtc/webrtc/test/test_suite.cc
andrew@webrtc.org 31628aae7e Upgrade scoped_ptr to Chromium's latest version.
Analogous to the recent libjingle change: http://cl/54929753-p10.
This supports scoped_ptr<T[]> and scoped_ptr<C, FreeDeleter> rather
than scoped_array and scoped_ptr_malloc respectively.

- Add Chromium's template-based COMPILE_ASSERT. We didn't have this
previously in order to support the macro in C. Instead, move the
existing macro to compile_assert_c.h.
- Additionally copy the move.h and template_util.h depedencies and add
the WARN_UNUSED_RESULT macro.
- Leave scoped_array and scoped_ptr_malloc for now, but mark as
deprecated.
- Remove scoped_ptr foo(NULL) use. The default constructor handles it.
- Remove the now redundant COMPILE_ASSERT from peerconnection_jni.cc.
- Add a CHECK_ARRAY_SIZE macro to rtp_format_vp8_unittest.cc to remove
some repeated code.

TESTED=trybots
R=pbos@webrtc.org, tommi@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5015 4adac7df-926f-26a2-2b94-8c16560cd09d
2013-10-22 12:50:00 +00:00

53 lines
1.4 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 "gflags/gflags.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"
DEFINE_bool(logs, false, "print logs to stderr");
namespace webrtc {
namespace test {
TestSuite::TestSuite(int argc, char** argv) {
SetExecutablePath(argv[0]);
testing::InitGoogleMock(&argc, argv); // Runs InitGoogleTest() internally.
// AllowCommandLineParsing allows us to ignore flags passed on to us by
// Chromium build bots without having to explicitly disable them.
google::AllowCommandLineReparsing();
google::ParseCommandLineFlags(&argc, &argv, true);
}
TestSuite::~TestSuite() {
}
int TestSuite::Run() {
Initialize();
int result = RUN_ALL_TESTS();
Shutdown();
return result;
}
void TestSuite::Initialize() {
if (FLAGS_logs)
trace_to_stderr_.reset(new TraceToStderr);
}
void TestSuite::Shutdown() {
}
} // namespace test
} // namespace webrtc