From d64d4c8eae596c5827f022d016a25c34379369f6 Mon Sep 17 00:00:00 2001 From: "bajones@chromium.org" Date: Wed, 11 Sep 2013 17:46:52 +0000 Subject: Added ability for Telemetry tests to specify their own command line args This will be critical to allowing the bots to communicate configuration details to the tests when using Recipies. BUG=278398 R=dtu@chromium.org, kbr@chromium.org Review URL: https://codereview.chromium.org/23698006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222587 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/telemetry/telemetry/test.py | 5 +++++ tools/telemetry/telemetry/test_runner.py | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'tools') diff --git a/tools/telemetry/telemetry/test.py b/tools/telemetry/telemetry/test.py index 1cda68a..d902fe0 100644 --- a/tools/telemetry/telemetry/test.py +++ b/tools/telemetry/telemetry/test.py @@ -76,3 +76,8 @@ class Test(object): @staticmethod def AddCommandLineOptions(parser): page_runner.AddCommandLineOptions(parser) + + @staticmethod + def AddTestCommandLineOptions(parser): + """Override to accept custom command line options.""" + pass diff --git a/tools/telemetry/telemetry/test_runner.py b/tools/telemetry/telemetry/test_runner.py index 9555341..0b0a834 100644 --- a/tools/telemetry/telemetry/test_runner.py +++ b/tools/telemetry/telemetry/test_runner.py @@ -96,6 +96,11 @@ class Run(Command): def AddParserOptions(self, parser): test.Test.AddCommandLineOptions(parser) + # Allow tests to add their own command line options + for arg in sys.argv[1:]: + if arg in _GetTests(): + _GetTests()[arg].AddTestCommandLineOptions(parser) + def ValidateCommandLine(self, parser, options, args): if not args: parser.error('Must provide at least one test name') -- cgit v1.1