OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Class for running instrumentation tests on a single device.""" | 5 """Class for running instrumentation tests on a single device.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import re | 9 import re |
10 import sys | 10 import sys |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 """Create a new TestRunner. | 59 """Create a new TestRunner. |
60 | 60 |
61 Args: | 61 Args: |
62 test_options: An InstrumentationOptions object. | 62 test_options: An InstrumentationOptions object. |
63 device: Attached android device. | 63 device: Attached android device. |
64 shard_index: Shard index. | 64 shard_index: Shard index. |
65 test_pkg: A TestPackage object. | 65 test_pkg: A TestPackage object. |
66 additional_flags: A list of additional flags to add to the command line. | 66 additional_flags: A list of additional flags to add to the command line. |
67 """ | 67 """ |
68 super(TestRunner, self).__init__(device, test_options.tool, | 68 super(TestRunner, self).__init__(device, test_options.tool, |
69 test_options.push_deps, | |
70 test_options.cleanup_test_files) | 69 test_options.cleanup_test_files) |
71 self._lighttp_port = constants.LIGHTTPD_RANDOM_PORT_FIRST + shard_index | 70 self._lighttp_port = constants.LIGHTTPD_RANDOM_PORT_FIRST + shard_index |
72 | 71 |
73 self.coverage_device_file = None | 72 self.coverage_device_file = None |
74 self.coverage_dir = test_options.coverage_dir | 73 self.coverage_dir = test_options.coverage_dir |
75 self.coverage_host_file = None | 74 self.coverage_host_file = None |
76 self.options = test_options | 75 self.options = test_options |
77 self.test_pkg = test_pkg | 76 self.test_pkg = test_pkg |
78 # Use the correct command line file for the package under test. | 77 # Use the correct command line file for the package under test. |
79 cmdline_file = [a.cmdline_file for a in constants.PACKAGE_INFO.itervalues() | 78 cmdline_file = [a.cmdline_file for a in constants.PACKAGE_INFO.itervalues() |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 except device_errors.CommandTimeoutError as e: | 507 except device_errors.CommandTimeoutError as e: |
509 results.AddResult(test_result.InstrumentationTestResult( | 508 results.AddResult(test_result.InstrumentationTestResult( |
510 test, base_test_result.ResultType.TIMEOUT, start_ms, duration_ms, | 509 test, base_test_result.ResultType.TIMEOUT, start_ms, duration_ms, |
511 log=str(e) or 'No information')) | 510 log=str(e) or 'No information')) |
512 except device_errors.DeviceUnreachableError as e: | 511 except device_errors.DeviceUnreachableError as e: |
513 results.AddResult(test_result.InstrumentationTestResult( | 512 results.AddResult(test_result.InstrumentationTestResult( |
514 test, base_test_result.ResultType.CRASH, start_ms, duration_ms, | 513 test, base_test_result.ResultType.CRASH, start_ms, duration_ms, |
515 log=str(e) or 'No information')) | 514 log=str(e) or 'No information')) |
516 self.TestTeardown(test, results) | 515 self.TestTeardown(test, results) |
517 return (results, None if results.DidRunPass() else test) | 516 return (results, None if results.DidRunPass() else test) |
OLD | NEW |