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 pexpect | |
9 import shutil | 8 import shutil |
10 import sys | 9 import sys |
11 import tempfile | 10 import tempfile |
12 | 11 |
13 import cmd_helper | 12 import cmd_helper |
14 import constants | 13 import constants |
15 from test_package import TestPackage | 14 from test_package import TestPackage |
| 15 from pylib import pexpect |
16 | 16 |
17 | 17 |
18 class TestPackageExecutable(TestPackage): | 18 class TestPackageExecutable(TestPackage): |
19 """A helper class for running stand-alone executables.""" | 19 """A helper class for running stand-alone executables.""" |
20 | 20 |
21 _TEST_RUNNER_RET_VAL_FILE = 'gtest_retval' | 21 _TEST_RUNNER_RET_VAL_FILE = 'gtest_retval' |
22 | 22 |
23 def __init__(self, adb, device, test_suite, timeout, rebaseline, | 23 def __init__(self, adb, device, test_suite, timeout, rebaseline, |
24 performance_test, cleanup_test_files, tool, dump_debug_info, | 24 performance_test, cleanup_test_files, tool, dump_debug_info, |
25 symbols_dir=None): | 25 symbols_dir=None): |
(...skipping 132 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 |