Chromium Code Reviews| Index: build/android/test_runner.py |
| diff --git a/build/android/test_runner.py b/build/android/test_runner.py |
| index b483d2b29e00444d4742ca5a6184963fc8ff7c55..d123ee04f043848b8928597eb8b6f0af8282e0f7 100755 |
| --- a/build/android/test_runner.py |
| +++ b/build/android/test_runner.py |
| @@ -116,6 +116,29 @@ def ProcessCommonOptions(options, error_func): |
| ', '.join(constants.VALID_ENVIRONMENTS)) |
| +def AddRemoteDeviceOptions(option_parser): |
| + group = optparse.OptionGroup(option_parser, 'Remote Device Options') |
| + group.add_option('--remote-device', default='Nexus 5', type='string', |
| + help=('Device type to run test on.')) |
| + group.add_option('--remote-device-os', default='4.4.2', type='string', |
| + help=('OS to have on the device.')) |
| + group.add_option('--api-key', default='', type='string', |
|
jbudorick
2014/12/01 17:38:40
We may want --api-key and --api-secret to have cor
rnephew (Reviews Here)
2014/12/02 19:47:49
Done.
|
| + help=('API key for remote devices.')) |
| + group.add_option('--api-secret', default='', type='string', |
| + help=('API secret for remote devices.')) |
| + group.add_option('--results-path', default='', type='string', |
| + help=('File path to download results to.')) |
| + group.add_option('--api-protocol', default='http', type='string', |
| + help=('HTTP protocol to use. (http or https)')) |
| + group.add_option('--api-address', default='172.22.21.180', type='string', |
| + help=('Address to send HTTP requests.')) |
| + group.add_option('--runner-type', default='', type='string', |
| + help=('Type of test to run as.')) |
| + group.add_option('--runner-package', default='', type='string', |
| + help=('Package name of test.')) |
| + option_parser.add_option_group(group) |
| + |
| + |
| def AddDeviceOptions(option_parser): |
| group = optparse.OptionGroup(option_parser, 'Device Options') |
| group.add_option('-c', dest='cleanup_test_files', |
| @@ -165,6 +188,7 @@ def AddGTestOptions(option_parser): |
| # in our other test types to handle these commands |
| AddCommonOptions(option_parser) |
| AddDeviceOptions(option_parser) |
| + AddRemoteDeviceOptions(option_parser) |
| def AddLinkerTestOptions(option_parser): |
| @@ -520,6 +544,22 @@ def ProcessMonkeyTestOptions(options, error_func): |
| options.extra_args) |
| +def AddUirobotTestOptions(option_parser): |
| + """Adds uirobot test options to |option_parser|.""" |
| + |
| + option_parser.usage = '%prog uirobot [options]' |
| + option_parser.commands_dict = {} |
| + option_parser.example = ( |
| + '%prog monkey --minutes=1') |
| + |
| + option_parser.add_option( |
| + '--minutes', default=5, type='string', |
| + help='Number of minutes to run uirobot test [default: %default].') |
| + |
| + AddCommonOptions(option_parser) |
| + AddDeviceOptions(option_parser) |
| + AddRemoteDeviceOptions(option_parser) |
| + |
| def AddPerfTestOptions(option_parser): |
| """Adds perf test options to |option_parser|.""" |
| @@ -902,7 +942,7 @@ def RunTestsCommand(command, options, args, option_parser): |
| _SUPPORTED_IN_PLATFORM_MODE = [ |
| # TODO(jbudorick): Add support for more test types. |
| - 'gtest', |
| + 'gtest', 'uirobot', |
| ] |
| @@ -917,7 +957,13 @@ def RunTestsInPlatformMode(command, options, option_parser): |
| command, options, option_parser.error) as test: |
| with test_run_factory.CreateTestRun( |
| options, env, test, option_parser.error) as test_run: |
| - results = test_run.RunTests() |
| + results = test_run.RunTest() |
| + |
| + # TODO(rnephew): Get rid of this when results handling |
|
jbudorick
2014/11/30 22:57:02
For now, let's stick with returning instances of B
rnephew (Reviews Here)
2014/12/02 19:47:49
Got rid of this code, but the appurify stuff doesn
|
| + # for remote devics is ready. |
| + if options.environment == 'remote_device': |
| + print results |
| + return |
| report_results.LogFull( |
| results=results, |
| @@ -991,6 +1037,8 @@ VALID_COMMANDS = { |
| AddPythonTestOptions, RunTestsCommand), |
| 'linker': CommandFunctionTuple( |
| AddLinkerTestOptions, RunTestsCommand), |
| + 'uirobot': CommandFunctionTuple( |
| + AddUirobotTestOptions, RunTestsCommand), |
| 'help': CommandFunctionTuple(lambda option_parser: None, HelpCommand) |
| } |