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 | 10 |
11 from pylib import constants | 11 from pylib import constants |
12 from pylib.base import base_test_result | 12 from pylib.base import base_test_result |
13 from pylib.remote.device import appurify_sanitized | 13 from pylib.remote.device import appurify_sanitized |
14 from pylib.remote.device import remote_device_test_run | 14 from pylib.remote.device import remote_device_test_run |
15 from pylib.remote.device import remote_device_helper | 15 from pylib.remote.device import remote_device_helper |
16 | 16 |
17 | 17 |
18 class RemoteDeviceGtestRun(remote_device_test_run.RemoteDeviceTestRun): | 18 class RemoteDeviceGtestRun(remote_device_test_run.RemoteDeviceTestRun): |
19 """Run gtests and uirobot tests on a remote device.""" | 19 """Run gtests and uirobot tests on a remote device.""" |
20 | 20 |
21 DEFAULT_RUNNER_PACKAGE = ( | 21 DEFAULT_RUNNER_PACKAGE = ( |
22 'org.chromium.native_test.ChromiumNativeTestInstrumentationTestRunner') | 22 'org.chromium.native_test.ChromeNativeTestInstrumentationTestRunner') |
23 | 23 |
24 #override | 24 #override |
25 def TestPackage(self): | 25 def TestPackage(self): |
26 return self._test_instance.suite | 26 return self._test_instance.suite |
27 | 27 |
28 #override | 28 #override |
29 def _TriggerSetUp(self): | 29 def _TriggerSetUp(self): |
30 """Set up the triggering of a test run.""" | 30 """Set up the triggering of a test run.""" |
31 logging.info('Triggering test run.') | 31 logging.info('Triggering test run.') |
32 | 32 |
(...skipping 22 matching lines...) Expand all Loading... |
55 if self._results['results']['exception']: | 55 if self._results['results']['exception']: |
56 results.AddResult(base_test_result.BaseTestResult( | 56 results.AddResult(base_test_result.BaseTestResult( |
57 self._results['results']['exception'], | 57 self._results['results']['exception'], |
58 base_test_result.ResultType.FAIL)) | 58 base_test_result.ResultType.FAIL)) |
59 else: | 59 else: |
60 output = self._results['results']['output'].splitlines() | 60 output = self._results['results']['output'].splitlines() |
61 output = (l[len(self._INSTRUMENTATION_STREAM_LEADER):] for l in output | 61 output = (l[len(self._INSTRUMENTATION_STREAM_LEADER):] for l in output |
62 if l.startswith(self._INSTRUMENTATION_STREAM_LEADER)) | 62 if l.startswith(self._INSTRUMENTATION_STREAM_LEADER)) |
63 results_list = self._test_instance.ParseGTestOutput(output) | 63 results_list = self._test_instance.ParseGTestOutput(output) |
64 results.AddResults(results_list) | 64 results.AddResults(results_list) |
| 65 if not self._results['results']['pass']: |
| 66 results.AddResult(base_test_result.BaseTestResult( |
| 67 'Remote Service detected error.', |
| 68 base_test_result.ResultType.FAIL)) |
65 return results | 69 return results |
OLD | NEW |