| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 sh_script_file.name, | 116 sh_script_file.name, |
| 117 constants.TEST_EXECUTABLE_DIR + '/chrome_test_runner.sh') | 117 constants.TEST_EXECUTABLE_DIR + '/chrome_test_runner.sh') |
| 118 logging.info('Conents of the test runner script: ') | 118 logging.info('Conents of the test runner script: ') |
| 119 for line in open(sh_script_file.name).readlines(): | 119 for line in open(sh_script_file.name).readlines(): |
| 120 logging.info(' ' + line.rstrip()) | 120 logging.info(' ' + line.rstrip()) |
| 121 | 121 |
| 122 def RunTestsAndListResults(self): | 122 def RunTestsAndListResults(self): |
| 123 """Runs all the tests and checks for failures. | 123 """Runs all the tests and checks for failures. |
| 124 | 124 |
| 125 Returns: | 125 Returns: |
| 126 A TestResults object. | 126 A TestRunResults object. |
| 127 """ | 127 """ |
| 128 args = ['adb', '-s', self.device, 'shell', 'sh', | 128 args = ['adb', '-s', self.device, 'shell', 'sh', |
| 129 constants.TEST_EXECUTABLE_DIR + '/chrome_test_runner.sh'] | 129 constants.TEST_EXECUTABLE_DIR + '/chrome_test_runner.sh'] |
| 130 logging.info(args) | 130 logging.info(args) |
| 131 p = pexpect.spawn(args[0], args[1:], logfile=sys.stdout) | 131 p = pexpect.spawn(args[0], args[1:], logfile=sys.stdout) |
| 132 return self._WatchTestOutput(p) | 132 return self._WatchTestOutput(p) |
| 133 | 133 |
| 134 def StripAndCopyExecutable(self): | 134 def StripAndCopyExecutable(self): |
| 135 """Strips and copies the executable to the device.""" | 135 """Strips and copies the executable to the device.""" |
| 136 if self.tool.NeedsDebugInfo(): | 136 if self.tool.NeedsDebugInfo(): |
| (...skipping 20 matching lines...) Expand all Loading... |
| 157 os.makedirs(self.symbols_dir) | 157 os.makedirs(self.symbols_dir) |
| 158 shutil.copy(self.test_suite, self.symbols_dir) | 158 shutil.copy(self.test_suite, self.symbols_dir) |
| 159 strip = os.environ['STRIP'] | 159 strip = os.environ['STRIP'] |
| 160 cmd_helper.RunCmd([strip, self.test_suite, '-o', target_name]) | 160 cmd_helper.RunCmd([strip, self.test_suite, '-o', target_name]) |
| 161 test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.test_suite_basename | 161 test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.test_suite_basename |
| 162 self.adb.PushIfNeeded(target_name, test_binary) | 162 self.adb.PushIfNeeded(target_name, test_binary) |
| 163 | 163 |
| 164 def _GetTestSuiteBaseName(self): | 164 def _GetTestSuiteBaseName(self): |
| 165 """Returns the base name of the test suite.""" | 165 """Returns the base name of the test suite.""" |
| 166 return os.path.basename(self.test_suite) | 166 return os.path.basename(self.test_suite) |
| OLD | NEW |