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_LAUNCHER_UNIT_TEST_LAUNCHER_H_ | 5 #ifndef BASE_TEST_LAUNCHER_UNIT_TEST_LAUNCHER_H_ |
6 #define BASE_TEST_LAUNCHER_UNIT_TEST_LAUNCHER_H_ | 6 #define BASE_TEST_LAUNCHER_UNIT_TEST_LAUNCHER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/test/launcher/test_launcher.h" | 10 #include "base/test/launcher/test_launcher.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 | 13 |
14 // Callback that runs a test suite and returns exit code. | 14 // Callback that runs a test suite and returns exit code. |
15 typedef base::Callback<int(void)> RunTestSuiteCallback; | 15 typedef base::Callback<int(void)> RunTestSuiteCallback; |
16 | 16 |
17 // Launches unit tests in given test suite. Returns exit code. | 17 // Launches unit tests in given test suite. Returns exit code. |
18 int LaunchUnitTests(int argc, | 18 int LaunchUnitTests(int argc, |
19 char** argv, | 19 char** argv, |
20 const RunTestSuiteCallback& run_test_suite); | 20 const RunTestSuiteCallback& run_test_suite); |
21 | 21 |
22 // Same as above, but always runs tests serially. | 22 // Same as above, but always runs tests serially. |
23 int LaunchUnitTestsSerially(int argc, | 23 int LaunchUnitTestsSerially(int argc, |
24 char** argv, | 24 char** argv, |
25 const RunTestSuiteCallback& run_test_suite); | 25 const RunTestSuiteCallback& run_test_suite); |
26 | 26 |
| 27 // Launches unit tests in given test suite. Returns exit code. |
| 28 // |default_jobs| is the default number of parallel test jobs. |
| 29 // |default_batch_limit| is the default size of test batch |
| 30 // (use 0 to disable batching). |
| 31 // |use_job_objects| determines whether to use job objects. |
| 32 int LaunchUnitTestsWithOptions( |
| 33 int argc, |
| 34 char** argv, |
| 35 int default_jobs, |
| 36 int default_batch_limit, |
| 37 bool use_job_objects, |
| 38 const RunTestSuiteCallback& run_test_suite); |
| 39 |
27 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
28 // Launches unit tests in given test suite. Returns exit code. | 41 // Launches unit tests in given test suite. Returns exit code. |
29 // |use_job_objects| determines whether to use job objects. | 42 // |use_job_objects| determines whether to use job objects. |
30 int LaunchUnitTests(int argc, | 43 int LaunchUnitTests(int argc, |
31 wchar_t** argv, | 44 wchar_t** argv, |
32 bool use_job_objects, | 45 bool use_job_objects, |
33 const RunTestSuiteCallback& run_test_suite); | 46 const RunTestSuiteCallback& run_test_suite); |
34 #endif // defined(OS_WIN) | 47 #endif // defined(OS_WIN) |
35 | 48 |
36 // Delegate to abstract away platform differences for unit tests. | 49 // Delegate to abstract away platform differences for unit tests. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 116 |
104 // Determines whether we use job objects on Windows. | 117 // Determines whether we use job objects on Windows. |
105 bool use_job_objects_; | 118 bool use_job_objects_; |
106 | 119 |
107 DISALLOW_COPY_AND_ASSIGN(UnitTestLauncherDelegate); | 120 DISALLOW_COPY_AND_ASSIGN(UnitTestLauncherDelegate); |
108 }; | 121 }; |
109 | 122 |
110 } // namespace base | 123 } // namespace base |
111 | 124 |
112 #endif // BASE_TEST_LAUNCHER_UNIT_TEST_LAUNCHER_H_ | 125 #endif // BASE_TEST_LAUNCHER_UNIT_TEST_LAUNCHER_H_ |
OLD | NEW |