Commit f1b412c8 authored by Mostyn Bramley-Moore's avatar Mostyn Bramley-Moore Committed by Commit Bot

--gtest_filter should only change NumParallelJobs' default value

BUG=741927,735587

Change-Id: Ib95bd85e2f1ad14e27ba8fa76f8b52f8e137e830
Reviewed-on: https://chromium-review.googlesource.com/569159Reviewed-by: default avatarPaweł Hajdan Jr. <phajdan.jr@chromium.org>
Commit-Queue: Mostyn Bramley-Moore <mostynb@opera.com>
Cr-Commit-Position: refs/heads/master@{#486773}
parent daffb849
......@@ -1193,13 +1193,10 @@ size_t NumParallelJobs() {
CommandLine* command_line = CommandLine::ForCurrentProcess();
CommandLine::SwitchMap switches = command_line->GetSwitches();
size_t jobs = 0U;
if (command_line->HasSwitch(switches::kTestLauncherJobs)) {
// If the number of test launcher jobs was specified, return that number.
size_t jobs = 0U;
if (command_line->HasSwitch(kGTestFilterFlag) && !BotModeEnabled()) {
// Do not run jobs in parallel by default if we are running a subset of
// the tests and if bot mode is off.
return 1U;
} else if (command_line->HasSwitch(switches::kTestLauncherJobs)) {
if (!StringToSizeT(
command_line->GetSwitchValueASCII(switches::kTestLauncherJobs),
&jobs) ||
......@@ -1207,10 +1204,13 @@ size_t NumParallelJobs() {
LOG(ERROR) << "Invalid value for " << switches::kTestLauncherJobs;
return 0U;
}
return jobs;
} else if (command_line->HasSwitch(kGTestFilterFlag) && !BotModeEnabled()) {
// Do not run jobs in parallel by default if we are running a subset of
// the tests and if bot mode is off.
return 1U;
}
// Default to the number of processor cores.
return base::checked_cast<size_t>(SysInfo::NumberOfProcessors());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment