OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 | 5 |
6 import logging | 6 import logging |
7 import os | 7 import os |
8 import shutil | 8 import shutil |
9 import sys | 9 import sys |
10 import tempfile | 10 import tempfile |
(...skipping 30 matching lines...) Expand all Loading... |
41 rebaseline, performance_test, cleanup_test_files, | 41 rebaseline, performance_test, cleanup_test_files, |
42 tool, dump_debug_info) | 42 tool, dump_debug_info) |
43 self.symbols_dir = symbols_dir | 43 self.symbols_dir = symbols_dir |
44 | 44 |
45 def _GetGTestReturnCode(self): | 45 def _GetGTestReturnCode(self): |
46 ret = None | 46 ret = None |
47 ret_code = 1 # Assume failure if we can't find it | 47 ret_code = 1 # Assume failure if we can't find it |
48 ret_code_file = tempfile.NamedTemporaryFile() | 48 ret_code_file = tempfile.NamedTemporaryFile() |
49 try: | 49 try: |
50 if not self.adb.Adb().Pull( | 50 if not self.adb.Adb().Pull( |
51 self.adb.GetExternalStorage() + '/' + | 51 constants.TEST_EXECUTABLE_DIR + '/' + |
52 TestPackageExecutable._TEST_RUNNER_RET_VAL_FILE, | 52 TestPackageExecutable._TEST_RUNNER_RET_VAL_FILE, |
53 ret_code_file.name): | 53 ret_code_file.name): |
54 logging.critical('Unable to pull gtest ret val file %s', | 54 logging.critical('Unable to pull gtest ret val file %s', |
55 ret_code_file.name) | 55 ret_code_file.name) |
56 raise ValueError | 56 raise ValueError |
57 ret_code = file(ret_code_file.name).read() | 57 ret_code = file(ret_code_file.name).read() |
58 ret = int(ret_code) | 58 ret = int(ret_code) |
59 except ValueError: | 59 except ValueError: |
60 logging.critical('Error reading gtest ret val file %s [%s]', | 60 logging.critical('Error reading gtest ret val file %s [%s]', |
61 ret_code_file.name, ret_code) | 61 ret_code_file.name, ret_code) |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 os.makedirs(self.symbols_dir) | 158 os.makedirs(self.symbols_dir) |
159 shutil.copy(self.test_suite, self.symbols_dir) | 159 shutil.copy(self.test_suite, self.symbols_dir) |
160 strip = os.environ['STRIP'] | 160 strip = os.environ['STRIP'] |
161 cmd_helper.RunCmd([strip, self.test_suite, '-o', target_name]) | 161 cmd_helper.RunCmd([strip, self.test_suite, '-o', target_name]) |
162 test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.test_suite_basename | 162 test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.test_suite_basename |
163 self.adb.PushIfNeeded(target_name, test_binary) | 163 self.adb.PushIfNeeded(target_name, test_binary) |
164 | 164 |
165 def _GetTestSuiteBaseName(self): | 165 def _GetTestSuiteBaseName(self): |
166 """Returns the base name of the test suite.""" | 166 """Returns the base name of the test suite.""" |
167 return os.path.basename(self.test_suite) | 167 return os.path.basename(self.test_suite) |
OLD | NEW |