| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/test/test_launcher/test_runner.h" | 5 #include "chrome/test/test_launcher/test_runner.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/process_util.h" | 11 #include "base/process_util.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 const wchar_t* const kGTestListTestsFlag = L"gtest_list_tests"; | 17 const char kGTestListTestsFlag[] = "gtest_list_tests"; |
| 18 const wchar_t* const kGTestRunDisabledTestsFlag = | 18 const char kGTestRunDisabledTestsFlag[] = "gtest_also_run_disabled_tests"; |
| 19 L"gtest_also_run_disabled_tests"; | |
| 20 | 19 |
| 21 // Retrieves the list of tests to run by running gtest with the | 20 // Retrieves the list of tests to run by running gtest with the |
| 22 // --gtest_list_tests flag in a forked process and parsing its output. | 21 // --gtest_list_tests flag in a forked process and parsing its output. |
| 23 // |command_line| should contain the command line used to start the browser | 22 // |command_line| should contain the command line used to start the browser |
| 24 // test launcher, it is expected that it does not contain the | 23 // test launcher, it is expected that it does not contain the |
| 25 // --gtest_list_tests flag already. | 24 // --gtest_list_tests flag already. |
| 26 // Note: we cannot implement this in-process for InProcessTestRunner as GTest | 25 // Note: we cannot implement this in-process for InProcessTestRunner as GTest |
| 27 // prints to the stdout and there are no good way of temporarily redirecting | 26 // prints to the stdout and there are no good way of temporarily redirecting |
| 28 // outputs. | 27 // outputs. |
| 29 bool GetTestList(const CommandLine& command_line, | 28 bool GetTestList(const CommandLine& command_line, |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 printf("Failing tests:\n"); | 122 printf("Failing tests:\n"); |
| 124 for (std::vector<std::string>::const_iterator iter = failed_tests.begin(); | 123 for (std::vector<std::string>::const_iterator iter = failed_tests.begin(); |
| 125 iter != failed_tests.end(); ++iter) { | 124 iter != failed_tests.end(); ++iter) { |
| 126 printf("%s\n", iter->c_str()); | 125 printf("%s\n", iter->c_str()); |
| 127 } | 126 } |
| 128 | 127 |
| 129 return false; | 128 return false; |
| 130 } | 129 } |
| 131 | 130 |
| 132 } // namespace | 131 } // namespace |
| OLD | NEW |