OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/test/launcher/unit_test_launcher.h" | 5 #include "base/test/launcher/unit_test_launcher.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/test/gtest_util.h" | 9 #include "base/test/gtest_util.h" |
10 #include "base/test/gtest_xml_unittest_result_printer.h" | 10 #include "base/test/gtest_xml_unittest_result_printer.h" |
11 #include "base/test/test_switches.h" | 11 #include "base/test/test_switches.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/googletest/include/gtest/gtest.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 | 15 |
16 int LaunchUnitTests(int argc, | 16 int LaunchUnitTests(int argc, |
17 char** argv, | 17 char** argv, |
18 const RunTestSuiteCallback& run_test_suite) { | 18 const RunTestSuiteCallback& run_test_suite) { |
19 CHECK(CommandLine::InitializedForCurrentProcess() || | 19 CHECK(CommandLine::InitializedForCurrentProcess() || |
20 CommandLine::Init(argc, argv)); | 20 CommandLine::Init(argc, argv)); |
21 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 21 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
22 if (command_line->HasSwitch(switches::kTestLauncherListTests)) { | 22 if (command_line->HasSwitch(switches::kTestLauncherListTests)) { |
(...skipping 19 matching lines...) Expand all Loading... |
42 XmlUnitTestResultPrinter* printer = new XmlUnitTestResultPrinter; | 42 XmlUnitTestResultPrinter* printer = new XmlUnitTestResultPrinter; |
43 CHECK(printer->Initialize(output_path)); | 43 CHECK(printer->Initialize(output_path)); |
44 testing::UnitTest::GetInstance()->listeners().Append(printer); | 44 testing::UnitTest::GetInstance()->listeners().Append(printer); |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 return run_test_suite.Run(); | 48 return run_test_suite.Run(); |
49 } | 49 } |
50 | 50 |
51 } // namespace base | 51 } // namespace base |
OLD | NEW |