| 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 | 8 import pexpect |
| 9 import shutil | 9 import shutil |
| 10 import sys | 10 import sys |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 logging.info('NATIVE_COVERAGE_DEPTH_STRIP is not defined: ' | 73 logging.info('NATIVE_COVERAGE_DEPTH_STRIP is not defined: ' |
| 74 'No native coverage.') | 74 'No native coverage.') |
| 75 return '' | 75 return '' |
| 76 export_string = 'export GCOV_PREFIX="/data/local/tmp/gcov"\n' | 76 export_string = 'export GCOV_PREFIX="/data/local/tmp/gcov"\n' |
| 77 export_string += 'export GCOV_PREFIX_STRIP=%s\n' % depth | 77 export_string += 'export GCOV_PREFIX_STRIP=%s\n' % depth |
| 78 return export_string | 78 return export_string |
| 79 | 79 |
| 80 def GetAllTests(self): | 80 def GetAllTests(self): |
| 81 """Returns a list of all tests available in the test suite.""" | 81 """Returns a list of all tests available in the test suite.""" |
| 82 all_tests = self.adb.RunShellCommand( | 82 all_tests = self.adb.RunShellCommand( |
| 83 '/data/local/tmp/%s --gtest_list_tests' % self.test_suite_basename) | 83 '%s /data/local/tmp/%s --gtest_list_tests' % |
| 84 (self.tool.GetTestWrapper(), self.test_suite_basename)) |
| 84 return self._ParseGTestListTests(all_tests) | 85 return self._ParseGTestListTests(all_tests) |
| 85 | 86 |
| 86 def CreateTestRunnerScript(self, gtest_filter, test_arguments): | 87 def CreateTestRunnerScript(self, gtest_filter, test_arguments): |
| 87 """Creates a test runner script and pushes to the device. | 88 """Creates a test runner script and pushes to the device. |
| 88 | 89 |
| 89 Args: | 90 Args: |
| 90 gtest_filter: A gtest_filter flag. | 91 gtest_filter: A gtest_filter flag. |
| 91 test_arguments: Additional arguments to pass to the test binary. | 92 test_arguments: Additional arguments to pass to the test binary. |
| 92 """ | 93 """ |
| 93 tool_wrapper = self.tool.GetTestWrapper() | 94 tool_wrapper = self.tool.GetTestWrapper() |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 os.makedirs(self.symbols_dir) | 149 os.makedirs(self.symbols_dir) |
| 149 shutil.copy(self.test_suite, self.symbols_dir) | 150 shutil.copy(self.test_suite, self.symbols_dir) |
| 150 strip = os.environ['STRIP'] | 151 strip = os.environ['STRIP'] |
| 151 cmd_helper.RunCmd([strip, self.test_suite, '-o', target_name]) | 152 cmd_helper.RunCmd([strip, self.test_suite, '-o', target_name]) |
| 152 test_binary = '/data/local/tmp/' + self.test_suite_basename | 153 test_binary = '/data/local/tmp/' + self.test_suite_basename |
| 153 self.adb.PushIfNeeded(target_name, test_binary) | 154 self.adb.PushIfNeeded(target_name, test_binary) |
| 154 | 155 |
| 155 def _GetTestSuiteBaseName(self): | 156 def _GetTestSuiteBaseName(self): |
| 156 """Returns the base name of the test suite.""" | 157 """Returns the base name of the test suite.""" |
| 157 return os.path.basename(self.test_suite) | 158 return os.path.basename(self.test_suite) |
| OLD | NEW |