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 import fnmatch | 5 import fnmatch |
6 import imp | 6 import imp |
7 import logging | 7 import logging |
| 8 import posixpath |
8 import signal | 9 import signal |
9 import thread | 10 import thread |
10 import threading | 11 import threading |
11 | 12 |
12 from devil.utils import signal_handler | 13 from devil.utils import signal_handler |
13 from pylib import valgrind_tools | 14 from pylib import valgrind_tools |
14 from pylib.base import base_test_result | 15 from pylib.base import base_test_result |
15 from pylib.base import test_run | 16 from pylib.base import test_run |
16 from pylib.base import test_collection | 17 from pylib.base import test_collection |
17 from pylib.local.device import local_device_environment | 18 from pylib.local.device import local_device_environment |
(...skipping 19 matching lines...) Expand all Loading... |
37 installer_script) | 38 installer_script) |
38 params = install_wrapper.GetInstallParameters() | 39 params = install_wrapper.GetInstallParameters() |
39 | 40 |
40 from incremental_install import installer | 41 from incremental_install import installer |
41 installer.Install(device, apk_helper, split_globs=params['splits'], | 42 installer.Install(device, apk_helper, split_globs=params['splits'], |
42 native_libs=params['native_libs'], | 43 native_libs=params['native_libs'], |
43 dex_files=params['dex_files'], | 44 dex_files=params['dex_files'], |
44 permissions=None) # Auto-grant permissions from manifest. | 45 permissions=None) # Auto-grant permissions from manifest. |
45 | 46 |
46 | 47 |
| 48 def SubstituteDeviceRoot(device_path, device_root): |
| 49 if not device_path: |
| 50 return device_root |
| 51 elif isinstance(device_path, list): |
| 52 return posixpath.join(*(p if p else device_root for p in device_path)) |
| 53 else: |
| 54 return device_path |
| 55 |
| 56 |
47 class LocalDeviceTestRun(test_run.TestRun): | 57 class LocalDeviceTestRun(test_run.TestRun): |
48 | 58 |
49 def __init__(self, env, test_instance): | 59 def __init__(self, env, test_instance): |
50 super(LocalDeviceTestRun, self).__init__(env, test_instance) | 60 super(LocalDeviceTestRun, self).__init__(env, test_instance) |
51 self._tools = {} | 61 self._tools = {} |
52 | 62 |
53 #override | 63 #override |
54 def RunTests(self): | 64 def RunTests(self): |
55 tests = self._GetTests() | 65 tests = self._GetTests() |
56 | 66 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 197 |
188 def _RunTest(self, device, test): | 198 def _RunTest(self, device, test): |
189 raise NotImplementedError | 199 raise NotImplementedError |
190 | 200 |
191 def _ShouldShard(self): | 201 def _ShouldShard(self): |
192 raise NotImplementedError | 202 raise NotImplementedError |
193 | 203 |
194 | 204 |
195 class NoTestsError(Exception): | 205 class NoTestsError(Exception): |
196 """Error for when no tests are found.""" | 206 """Error for when no tests are found.""" |
OLD | NEW |