Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(848)

Unified Diff: base/test/launcher/unit_test_launcher.cc

Issue 1218843002: Revert "Support disabling unit test batching. Use it for angle_end2end_tests" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/test/launcher/unit_test_launcher.h ('k') | gpu/angle_end2end_tests_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « base/test/launcher/unit_test_launcher.h ('k') | gpu/angle_end2end_tests_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698