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 tempfile | 9 import tempfile |
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.gtest import gtest_test_instance | 13 from pylib.gtest import gtest_test_instance |
14 from pylib.remote.device import remote_device_test_run | 14 from pylib.remote.device import remote_device_test_run |
15 | 15 |
16 | 16 |
17 _EXTRA_COMMAND_LINE_FILE = ( | 17 _EXTRA_COMMAND_LINE_FILE = ( |
18 'org.chromium.native_test.NativeTestActivity.CommandLineFile') | 18 'org.chromium.native_test.NativeTest.CommandLineFile') |
19 | 19 |
20 | 20 |
21 class RemoteDeviceGtestTestRun(remote_device_test_run.RemoteDeviceTestRun): | 21 class RemoteDeviceGtestTestRun(remote_device_test_run.RemoteDeviceTestRun): |
22 """Run gtests and uirobot tests on a remote device.""" | 22 """Run gtests and uirobot tests on a remote device.""" |
23 | 23 |
24 DEFAULT_RUNNER_PACKAGE = ( | 24 DEFAULT_RUNNER_PACKAGE = ( |
25 'org.chromium.native_test.NativeTestInstrumentationTestRunner') | 25 'org.chromium.native_test.NativeTestInstrumentationTestRunner') |
26 | 26 |
27 #override | 27 #override |
28 def TestPackage(self): | 28 def TestPackage(self): |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 logging.info('Parsing results from stdout.') | 80 logging.info('Parsing results from stdout.') |
81 results = base_test_result.TestRunResults() | 81 results = base_test_result.TestRunResults() |
82 output = self._results['results']['output'].splitlines() | 82 output = self._results['results']['output'].splitlines() |
83 output = (l[len(self._INSTRUMENTATION_STREAM_LEADER):] for l in output | 83 output = (l[len(self._INSTRUMENTATION_STREAM_LEADER):] for l in output |
84 if l.startswith(self._INSTRUMENTATION_STREAM_LEADER)) | 84 if l.startswith(self._INSTRUMENTATION_STREAM_LEADER)) |
85 results_list = self._test_instance.ParseGTestOutput(output) | 85 results_list = self._test_instance.ParseGTestOutput(output) |
86 results.AddResults(results_list) | 86 results.AddResults(results_list) |
87 | 87 |
88 self._DetectPlatformErrors(results) | 88 self._DetectPlatformErrors(results) |
89 return results | 89 return results |
OLD | NEW |