OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 """Runs linker tests on a particular device.""" | 5 """Runs linker tests on a particular device.""" |
6 | 6 |
7 import logging | 7 import logging |
8 import os.path | 8 import os.path |
9 import sys | 9 import sys |
10 import time | 10 import time |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 cleanup_test_files) | 65 cleanup_test_files) |
66 | 66 |
67 #override | 67 #override |
68 def InstallTestPackage(self): | 68 def InstallTestPackage(self): |
69 apk_path = os.path.join( | 69 apk_path = os.path.join( |
70 constants.GetOutDirectory(), 'apks', '%s.apk' % _PACKAGE_NAME) | 70 constants.GetOutDirectory(), 'apks', '%s.apk' % _PACKAGE_NAME) |
71 | 71 |
72 if not os.path.exists(apk_path): | 72 if not os.path.exists(apk_path): |
73 raise Exception('%s not found, please build it' % apk_path) | 73 raise Exception('%s not found, please build it' % apk_path) |
74 | 74 |
75 package_name = apk_helper.GetPackageName(apk_path) | 75 package_name = apk_helper.GetPackageName(constants.ANDROID_SDK_TOOLS, |
| 76 apk_path) |
76 self.adb.ManagedInstall(apk_path, package_name) | 77 self.adb.ManagedInstall(apk_path, package_name) |
77 | 78 |
78 #override | 79 #override |
79 def RunTest(self, test): | 80 def RunTest(self, test): |
80 """Sets up and runs a test case. | 81 """Sets up and runs a test case. |
81 | 82 |
82 Args: | 83 Args: |
83 test: An object which is ostensibly a subclass of LinkerTestCaseBase. | 84 test: An object which is ostensibly a subclass of LinkerTestCaseBase. |
84 | 85 |
85 Returns: | 86 Returns: |
(...skipping 10 matching lines...) Expand all Loading... |
96 test.tagged_name) | 97 test.tagged_name) |
97 exc_info = sys.exc_info() | 98 exc_info = sys.exc_info() |
98 results = base_test_result.TestRunResults() | 99 results = base_test_result.TestRunResults() |
99 results.AddResult(LinkerExceptionTestResult( | 100 results.AddResult(LinkerExceptionTestResult( |
100 test.tagged_name, exc_info)) | 101 test.tagged_name, exc_info)) |
101 | 102 |
102 if not results.DidRunPass(): | 103 if not results.DidRunPass(): |
103 return results, test | 104 return results, test |
104 else: | 105 else: |
105 return results, None | 106 return results, None |
OLD | NEW |