OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef BASE_TEST_TEST_LAUNCHER_H_ | 5 #ifndef BASE_TEST_TEST_LAUNCHER_H_ |
6 #define BASE_TEST_TEST_LAUNCHER_H_ | 6 #define BASE_TEST_TEST_LAUNCHER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 // If the delegate is running tests asynchronously, it must finish | 66 // If the delegate is running tests asynchronously, it must finish |
67 // running all pending tests and call their callbacks before returning | 67 // running all pending tests and call their callbacks before returning |
68 // from this method. | 68 // from this method. |
69 virtual void RunRemainingTests() = 0; | 69 virtual void RunRemainingTests() = 0; |
70 | 70 |
71 protected: | 71 protected: |
72 virtual ~TestLauncherDelegate(); | 72 virtual ~TestLauncherDelegate(); |
73 }; | 73 }; |
74 | 74 |
| 75 // Launches a child process (assumed to be gtest-based binary) |
| 76 // using |command_line|. If |wrapper| is not empty, it is prepended |
| 77 // to the final command line. If the child process is still running |
| 78 // after |timeout|, it is terminated and |*was_timeout| is set to true. |
75 int LaunchChildGTestProcess(const CommandLine& command_line, | 79 int LaunchChildGTestProcess(const CommandLine& command_line, |
| 80 const std::string& wrapper, |
76 base::TimeDelta timeout, | 81 base::TimeDelta timeout, |
77 bool* was_timeout); | 82 bool* was_timeout); |
78 | 83 |
79 // Launches GTest-based tests from the current executable | 84 // Launches GTest-based tests from the current executable |
80 // using |launcher_delegate|. | 85 // using |launcher_delegate|. |
81 int LaunchTests(TestLauncherDelegate* launcher_delegate, | 86 int LaunchTests(TestLauncherDelegate* launcher_delegate, |
82 int argc, | 87 int argc, |
83 char** argv) WARN_UNUSED_RESULT; | 88 char** argv) WARN_UNUSED_RESULT; |
84 | 89 |
85 } // namespace base | 90 } // namespace base |
86 | 91 |
87 #endif // BASE_TEST_TEST_LAUNCHER_H_ | 92 #endif // BASE_TEST_TEST_LAUNCHER_H_ |
OLD | NEW |