| 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 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 self._test_id = self._UploadTestToDevice(runner_type) | 48 self._test_id = self._UploadTestToDevice(runner_type) |
| 49 config_body = {'runner': runner_package} | 49 config_body = {'runner': runner_package} |
| 50 self._SetTestConfig(runner_type, config_body) | 50 self._SetTestConfig(runner_type, config_body) |
| 51 | 51 |
| 52 _INSTRUMENTATION_STREAM_LEADER = 'INSTRUMENTATION_STATUS: stream=' | 52 _INSTRUMENTATION_STREAM_LEADER = 'INSTRUMENTATION_STATUS: stream=' |
| 53 | 53 |
| 54 #override | 54 #override |
| 55 def _ParseTestResults(self): | 55 def _ParseTestResults(self): |
| 56 logging.info('Parsing results from stdout.') | 56 logging.info('Parsing results from stdout.') |
| 57 output = self._results['results']['output'].splitlines() | |
| 58 output = (l[len(self._INSTRUMENTATION_STREAM_LEADER):] for l in output | |
| 59 if l.startswith(self._INSTRUMENTATION_STREAM_LEADER)) | |
| 60 results_list = self._test_instance.ParseGTestOutput(output) | |
| 61 results = base_test_result.TestRunResults() | 57 results = base_test_result.TestRunResults() |
| 62 results.AddResults(results_list) | 58 if self._results['results']['exception']: |
| 59 results.AddResult(base_test_result.BaseTestResult( |
| 60 self._results['results']['exception'], |
| 61 base_test_result.ResultType.FAIL)) |
| 62 else: |
| 63 output = self._results['results']['output'].splitlines() |
| 64 output = (l[len(self._INSTRUMENTATION_STREAM_LEADER):] for l in output |
| 65 if l.startswith(self._INSTRUMENTATION_STREAM_LEADER)) |
| 66 results_list = self._test_instance.ParseGTestOutput(output) |
| 67 results.AddResults(results_list) |
| 63 return results | 68 return results |
| OLD | NEW |