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 30 matching lines...) Expand all Loading... |
41 additional_flags=None): | 41 additional_flags=None): |
42 """Create a new TestRunner. | 42 """Create a new TestRunner. |
43 | 43 |
44 Args: | 44 Args: |
45 test_options: An InstrumentationOptions object. | 45 test_options: An InstrumentationOptions object. |
46 device: Attached android device. | 46 device: Attached android device. |
47 shard_index: Shard index. | 47 shard_index: Shard index. |
48 test_pkg: A TestPackage object. | 48 test_pkg: A TestPackage object. |
49 additional_flags: A list of additional flags to add to the command line. | 49 additional_flags: A list of additional flags to add to the command line. |
50 """ | 50 """ |
51 super(TestRunner, self).__init__(device, test_options.tool, | 51 super(TestRunner, self).__init__(device, test_options.tool) |
52 test_options.cleanup_test_files) | |
53 self._lighttp_port = constants.LIGHTTPD_RANDOM_PORT_FIRST + shard_index | 52 self._lighttp_port = constants.LIGHTTPD_RANDOM_PORT_FIRST + shard_index |
54 self._logcat_monitor = None | 53 self._logcat_monitor = None |
55 | 54 |
56 self.coverage_device_file = None | 55 self.coverage_device_file = None |
57 self.coverage_dir = test_options.coverage_dir | 56 self.coverage_dir = test_options.coverage_dir |
58 self.coverage_host_file = None | 57 self.coverage_host_file = None |
59 self.options = test_options | 58 self.options = test_options |
60 self.test_pkg = test_pkg | 59 self.test_pkg = test_pkg |
61 # Use the correct command line file for the package under test. | 60 # Use the correct command line file for the package under test. |
62 cmdline_file = [a.cmdline_file for a in constants.PACKAGE_INFO.itervalues() | 61 cmdline_file = [a.cmdline_file for a in constants.PACKAGE_INFO.itervalues() |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 except device_errors.CommandTimeoutError as e: | 362 except device_errors.CommandTimeoutError as e: |
364 results.AddResult(test_result.InstrumentationTestResult( | 363 results.AddResult(test_result.InstrumentationTestResult( |
365 test, base_test_result.ResultType.TIMEOUT, start_ms, duration_ms, | 364 test, base_test_result.ResultType.TIMEOUT, start_ms, duration_ms, |
366 log=str(e) or 'No information')) | 365 log=str(e) or 'No information')) |
367 except device_errors.DeviceUnreachableError as e: | 366 except device_errors.DeviceUnreachableError as e: |
368 results.AddResult(test_result.InstrumentationTestResult( | 367 results.AddResult(test_result.InstrumentationTestResult( |
369 test, base_test_result.ResultType.CRASH, start_ms, duration_ms, | 368 test, base_test_result.ResultType.CRASH, start_ms, duration_ms, |
370 log=str(e) or 'No information')) | 369 log=str(e) or 'No information')) |
371 self.TestTeardown(test, results) | 370 self.TestTeardown(test, results) |
372 return (results, None if results.DidRunPass() else test) | 371 return (results, None if results.DidRunPass() else test) |
OLD | NEW |