OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """Run specific test on specific environment.""" | 5 """Run specific test on specific environment.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import sys | 9 import sys |
10 import tempfile | 10 import tempfile |
11 | 11 |
12 from pylib import constants | 12 from pylib import constants |
13 from pylib.base import base_test_result | 13 from pylib.base import base_test_result |
14 from pylib.remote.device import appurify_sanitized | 14 from pylib.remote.device import appurify_sanitized |
15 from pylib.remote.device import remote_device_test_run | 15 from pylib.remote.device import remote_device_test_run |
16 from pylib.remote.device import remote_device_helper | 16 from pylib.remote.device import remote_device_helper |
17 | 17 |
18 | 18 |
19 _EXTRA_COMMAND_LINE_FILE = ( | 19 _EXTRA_COMMAND_LINE_FILE = ( |
20 'org.chromium.native_test.ChromeNativeTestActivity.CommandLineFile') | 20 'org.chromium.native_test.ChromeNativeTestActivity.CommandLineFile') |
21 # TODO(jbudorick): Remove this extra when b/18981674 is fixed. | 21 # TODO(jbudorick): Remove this extra when b/18981674 is fixed. |
22 _EXTRA_ONLY_OUTPUT_FAILURES = ( | 22 _EXTRA_ONLY_OUTPUT_FAILURES = ( |
23 'org.chromium.native_test.ChromeNativeTestInstrumentationTestRunner.' | 23 'org.chromium.native_test.ChromeNativeTestInstrumentationTestRunner.' |
24 'OnlyOutputFailures') | 24 'OnlyOutputFailures') |
25 | 25 |
26 | 26 |
27 class RemoteDeviceGtestRun(remote_device_test_run.RemoteDeviceTestRun): | 27 class RemoteDeviceGtestTestRun(remote_device_test_run.RemoteDeviceTestRun): |
28 """Run gtests and uirobot tests on a remote device.""" | 28 """Run gtests and uirobot tests on a remote device.""" |
29 | 29 |
30 DEFAULT_RUNNER_PACKAGE = ( | 30 DEFAULT_RUNNER_PACKAGE = ( |
31 'org.chromium.native_test.ChromeNativeTestInstrumentationTestRunner') | 31 'org.chromium.native_test.ChromeNativeTestInstrumentationTestRunner') |
32 | 32 |
33 #override | 33 #override |
34 def TestPackage(self): | 34 def TestPackage(self): |
35 return self._test_instance.suite | 35 return self._test_instance.suite |
36 | 36 |
37 #override | 37 #override |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 if l.startswith(self._INSTRUMENTATION_STREAM_LEADER)) | 83 if l.startswith(self._INSTRUMENTATION_STREAM_LEADER)) |
84 results_list = self._test_instance.ParseGTestOutput(output) | 84 results_list = self._test_instance.ParseGTestOutput(output) |
85 results.AddResults(results_list) | 85 results.AddResults(results_list) |
86 if self._env.only_output_failures: | 86 if self._env.only_output_failures: |
87 logging.info('See logcat for more results information.') | 87 logging.info('See logcat for more results information.') |
88 if not self._results['results']['pass']: | 88 if not self._results['results']['pass']: |
89 results.AddResult(base_test_result.BaseTestResult( | 89 results.AddResult(base_test_result.BaseTestResult( |
90 'Remote Service detected error.', | 90 'Remote Service detected error.', |
91 base_test_result.ResultType.FAIL)) | 91 base_test_result.ResultType.FAIL)) |
92 return results | 92 return results |
OLD | NEW |