summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-14 01:07:29 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-14 01:07:29 +0000
commitf34b30fe315c2223367d1c24a756cba98756dfd9 (patch)
treef2591057831e4bbb018cf58315ce0fafed8d3387
parentd45a48b9913f90096ca27d887cd63a345a759b2c (diff)
downloadchromium_src-f34b30fe315c2223367d1c24a756cba98756dfd9.zip
chromium_src-f34b30fe315c2223367d1c24a756cba98756dfd9.tar.gz
chromium_src-f34b30fe315c2223367d1c24a756cba98756dfd9.tar.bz2
GTTF: Make the test launcher's retry limit configurable.
BUG=236893 R=sky@chromium.org Review URL: https://codereview.chromium.org/70973003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234998 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/test/launcher/test_launcher.cc15
-rw-r--r--base/test/test_switches.cc3
-rw-r--r--base/test/test_switches.h1
3 files changed, 18 insertions, 1 deletions
diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc
index 08a573b..ada3c1f 100644
--- a/base/test/launcher/test_launcher.cc
+++ b/base/test/launcher/test_launcher.cc
@@ -340,7 +340,7 @@ TestLauncher::TestLauncher(TestLauncherDelegate* launcher_delegate,
test_success_count_(0),
test_broken_count_(0),
retry_count_(0),
- retry_limit_(3), // TODO(phajdan.jr): Make a flag control this.
+ retry_limit_(3),
run_result_(true),
watchdog_timer_(FROM_HERE,
TimeDelta::FromSeconds(kOutputTimeoutSeconds),
@@ -640,6 +640,19 @@ bool TestLauncher::Init() {
return false;
}
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kTestLauncherRetryLimit)) {
+ int retry_limit = -1;
+ if (!StringToInt(CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kTestLauncherRetryLimit), &retry_limit) ||
+ retry_limit < 0) {
+ LOG(ERROR) << "Invalid value for " << switches::kTestLauncherRetryLimit;
+ return false;
+ }
+
+ retry_limit_ = retry_limit;
+ }
+
// Split --gtest_filter at '-', if there is one, to separate into
// positive filter and negative filter portions.
std::string filter = command_line->GetSwitchValueASCII(kGTestFilterFlag);
diff --git a/base/test/test_switches.cc b/base/test/test_switches.cc
index a3aebcd..ff8f315 100644
--- a/base/test/test_switches.cc
+++ b/base/test/test_switches.cc
@@ -22,6 +22,9 @@ const char switches::kTestLauncherJobs[] = "test-launcher-jobs";
// Path to test results file in our custom test launcher format.
const char switches::kTestLauncherOutput[] = "test-launcher-output";
+// Maximum number of times to retry a test after failure.
+const char switches::kTestLauncherRetryLimit[] = "test-launcher-retry-limit";
+
// Path to test results file with all the info from the test launcher.
const char switches::kTestLauncherSummaryOutput[] =
"test-launcher-summary-output";
diff --git a/base/test/test_switches.h b/base/test/test_switches.h
index c824047..b9cb0a5 100644
--- a/base/test/test_switches.h
+++ b/base/test/test_switches.h
@@ -14,6 +14,7 @@ extern const char kTestLauncherBatchLimit[];
extern const char kTestLauncherDeveloperMode[];
extern const char kTestLauncherJobs[];
extern const char kTestLauncherOutput[];
+extern const char kTestLauncherRetryLimit[];
extern const char kTestLauncherSummaryOutput[];
extern const char kTestLauncherPrintTestStdio[];
extern const char kTestLauncherShardIndex[];