(reland) base::LaunchUnitTestsSerially should not be overridable by cmdline
(reland) base::LaunchUnitTestsSerially should ignore the --test-launcher-jobs
command line switch, and never use parallel jobs. To achieve this, change
callers of base::TestLauncher to pass the requested number of parallel test
jobs, instead of the default number of parallel test jobs.
And while we're at it, let's remove TestLauncherDelegate's
AdjustDefaultParallelJobs method, which no longer has any users.
BUG=735587,736837
[email protected]
Change-Id: I4085fb21c1dce467527210407e3913ff3b5e3bc6
Reviewed-on: https://chromium-review.googlesource.com/549342
Commit-Queue: Mostyn Bramley-Moore <[email protected]>
Reviewed-by: Henrik Kjellander <[email protected]>
Reviewed-by: Alok Priyadarshi <[email protected]>
Reviewed-by: Paweł Hajdan Jr. <[email protected]>
Reviewed-by: Alex Clarke <[email protected]>
Cr-Commit-Position: refs/heads/master@{#483909}
diff --git a/content/test/content_test_launcher.cc b/content/test/content_test_launcher.cc
index 00e121d..de5ba9ed 100644
--- a/content/test/content_test_launcher.cc
+++ b/content/test/content_test_launcher.cc
@@ -12,6 +12,7 @@
#include "base/macros.h"
#include "base/process/memory.h"
#include "base/sys_info.h"
+#include "base/test/launcher/test_launcher.h"
#include "base/test/test_suite.h"
#include "base/test/test_timeouts.h"
#include "build/build_config.h"
@@ -126,7 +127,11 @@
} // namespace content
int main(int argc, char** argv) {
- int default_jobs = std::max(1, base::SysInfo::NumberOfProcessors() / 2);
+ base::CommandLine::Init(argc, argv);
+ size_t parallel_jobs = base::NumParallelJobs();
+ if (parallel_jobs > 1U) {
+ parallel_jobs /= 2U;
+ }
content::ContentTestLauncherDelegate launcher_delegate;
- return LaunchTests(&launcher_delegate, default_jobs, argc, argv);
+ return LaunchTests(&launcher_delegate, parallel_jobs, argc, argv);
}