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 |
11 | 11 |
12 import cmd_helper | 12 from pylib import cmd_helper |
13 import constants | 13 from pylib import constants |
| 14 from pylib import pexpect |
| 15 |
14 from test_package import TestPackage | 16 from test_package import TestPackage |
15 from pylib import pexpect | |
16 | 17 |
17 | 18 |
18 class TestPackageExecutable(TestPackage): | 19 class TestPackageExecutable(TestPackage): |
19 """A helper class for running stand-alone executables.""" | 20 """A helper class for running stand-alone executables.""" |
20 | 21 |
21 _TEST_RUNNER_RET_VAL_FILE = 'gtest_retval' | 22 _TEST_RUNNER_RET_VAL_FILE = 'gtest_retval' |
22 | 23 |
23 def __init__(self, adb, device, test_suite, timeout, | 24 def __init__(self, adb, device, test_suite, timeout, |
24 cleanup_test_files, tool, dump_debug_info, | 25 cleanup_test_files, tool, dump_debug_info, |
25 symbols_dir=None): | 26 symbols_dir=None): |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 os.makedirs(self.symbols_dir) | 155 os.makedirs(self.symbols_dir) |
155 shutil.copy(self.test_suite, self.symbols_dir) | 156 shutil.copy(self.test_suite, self.symbols_dir) |
156 strip = os.environ['STRIP'] | 157 strip = os.environ['STRIP'] |
157 cmd_helper.RunCmd([strip, self.test_suite, '-o', target_name]) | 158 cmd_helper.RunCmd([strip, self.test_suite, '-o', target_name]) |
158 test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.test_suite_basename | 159 test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.test_suite_basename |
159 self.adb.PushIfNeeded(target_name, test_binary) | 160 self.adb.PushIfNeeded(target_name, test_binary) |
160 | 161 |
161 def _GetTestSuiteBaseName(self): | 162 def _GetTestSuiteBaseName(self): |
162 """Returns the base name of the test suite.""" | 163 """Returns the base name of the test suite.""" |
163 return os.path.basename(self.test_suite) | 164 return os.path.basename(self.test_suite) |
OLD | NEW |