1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/at_exit.h"
7 #include "base/command_line.h"
8 #include "base/test/launcher/unit_test_launcher.h"
9 #include "base/test/test_suite.h"
10 #include "testing/gmock/include/gmock/gmock.h"
11 #include "testing/gtest/include/gtest/gtest.h"
15 class NoAtExitBaseTestSuite
: public base::TestSuite
{
17 NoAtExitBaseTestSuite(int argc
, char** argv
)
18 : base::TestSuite(argc
, argv
, false) {
22 int RunTestSuite(int argc
, char** argv
) {
23 return NoAtExitBaseTestSuite(argc
, argv
).Run();
28 int main(int argc
, char** argv
) {
29 // On Android, AtExitManager is created in
30 // testing/android/native_test_wrapper.cc before main() is called.
31 // The same thing is also done in base/test/test_suite.cc
32 #if !defined(OS_ANDROID)
33 base::AtExitManager exit_manager
;
35 CommandLine::Init(argc
, argv
);
36 testing::InitGoogleMock(&argc
, argv
);
37 return base::LaunchUnitTests(argc
,
39 base::Bind(&RunTestSuite
, argc
, argv
));