Index: base/test/launcher/unit_test_launcher.cc |
diff --git a/base/test/launcher/unit_test_launcher.cc b/base/test/launcher/unit_test_launcher.cc |
index ad7d2c558fd06ea1700c820c72ac3d46c7b5bc2c..ab6fa7220441eab3aebe891150bc934927f098fb 100644 |
--- a/base/test/launcher/unit_test_launcher.cc |
+++ b/base/test/launcher/unit_test_launcher.cc |
@@ -145,7 +145,7 @@ bool GetSwitchValueAsInt(const std::string& switch_name, int* result) { |
std::string switch_value = |
CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switch_name); |
- if (!StringToInt(switch_value, result) || *result < 0) { |
+ if (!StringToInt(switch_value, result) || *result < 1) { |
LOG(ERROR) << "Invalid value for " << switch_name << ": " << switch_value; |
return false; |
} |
@@ -155,7 +155,6 @@ bool GetSwitchValueAsInt(const std::string& switch_name, int* result) { |
int LaunchUnitTestsInternal(const RunTestSuiteCallback& run_test_suite, |
int default_jobs, |
- int default_batch_limit, |
bool use_job_objects, |
const Closure& gtest_init) { |
#if defined(OS_ANDROID) |
@@ -196,7 +195,7 @@ int LaunchUnitTestsInternal(const RunTestSuiteCallback& run_test_suite, |
gtest_init.Run(); |
TestTimeouts::Initialize(); |
- int batch_limit = default_batch_limit; |
+ int batch_limit = kDefaultTestBatchLimit; |
if (!GetSwitchValueAsInt(switches::kTestLauncherBatchLimit, &batch_limit)) |
return 1; |
@@ -421,40 +420,16 @@ int LaunchUnitTests(int argc, |
char** argv, |
const RunTestSuiteCallback& run_test_suite) { |
CommandLine::Init(argc, argv); |
- return LaunchUnitTestsInternal( |
- run_test_suite, |
- SysInfo::NumberOfProcessors(), |
- kDefaultTestBatchLimit, |
- true, |
- Bind(&InitGoogleTestChar, &argc, argv)); |
+ return LaunchUnitTestsInternal(run_test_suite, SysInfo::NumberOfProcessors(), |
+ true, Bind(&InitGoogleTestChar, &argc, argv)); |
} |
int LaunchUnitTestsSerially(int argc, |
char** argv, |
const RunTestSuiteCallback& run_test_suite) { |
CommandLine::Init(argc, argv); |
- return LaunchUnitTestsInternal( |
- run_test_suite, |
- 1, |
- kDefaultTestBatchLimit, |
- true, |
- Bind(&InitGoogleTestChar, &argc, argv)); |
-} |
- |
-int LaunchUnitTestsWithOptions( |
- int argc, |
- char** argv, |
- int default_jobs, |
- int default_batch_limit, |
- bool use_job_objects, |
- const RunTestSuiteCallback& run_test_suite) { |
- CommandLine::Init(argc, argv); |
- return LaunchUnitTestsInternal( |
- run_test_suite, |
- default_jobs, |
- default_batch_limit, |
- use_job_objects, |
- Bind(&InitGoogleTestChar, &argc, argv)); |
+ return LaunchUnitTestsInternal(run_test_suite, 1, true, |
+ Bind(&InitGoogleTestChar, &argc, argv)); |
} |
#if defined(OS_WIN) |
@@ -464,12 +439,9 @@ int LaunchUnitTests(int argc, |
const RunTestSuiteCallback& run_test_suite) { |
// Windows CommandLine::Init ignores argv anyway. |
CommandLine::Init(argc, NULL); |
- return LaunchUnitTestsInternal( |
- run_test_suite, |
- SysInfo::NumberOfProcessors(), |
- kDefaultTestBatchLimit, |
- use_job_objects, |
- Bind(&InitGoogleTestWChar, &argc, argv)); |
+ return LaunchUnitTestsInternal(run_test_suite, SysInfo::NumberOfProcessors(), |
+ use_job_objects, |
+ Bind(&InitGoogleTestWChar, &argc, argv)); |
} |
#endif // defined(OS_WIN) |