| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 depth = os.environ['NATIVE_COVERAGE_DEPTH_STRIP'] | 69 depth = os.environ['NATIVE_COVERAGE_DEPTH_STRIP'] |
| 70 except KeyError: | 70 except KeyError: |
| 71 logging.info('NATIVE_COVERAGE_DEPTH_STRIP is not defined: ' | 71 logging.info('NATIVE_COVERAGE_DEPTH_STRIP is not defined: ' |
| 72 'No native coverage.') | 72 'No native coverage.') |
| 73 return '' | 73 return '' |
| 74 export_string = ('export GCOV_PREFIX="%s/gcov"\n' % | 74 export_string = ('export GCOV_PREFIX="%s/gcov"\n' % |
| 75 self.adb.GetExternalStorage()) | 75 self.adb.GetExternalStorage()) |
| 76 export_string += 'export GCOV_PREFIX_STRIP=%s\n' % depth | 76 export_string += 'export GCOV_PREFIX_STRIP=%s\n' % depth |
| 77 return export_string | 77 return export_string |
| 78 | 78 |
| 79 def ClearApplicationState(self): |
| 80 """Clear the application state.""" |
| 81 self.adb.KillAllBlocking(self.test_suite_basename, 30) |
| 82 |
| 79 def GetAllTests(self): | 83 def GetAllTests(self): |
| 80 """Returns a list of all tests available in the test suite.""" | 84 """Returns a list of all tests available in the test suite.""" |
| 81 all_tests = self.adb.RunShellCommand( | 85 all_tests = self.adb.RunShellCommand( |
| 82 '%s %s/%s --gtest_list_tests' % | 86 '%s %s/%s --gtest_list_tests' % |
| 83 (self.tool.GetTestWrapper(), | 87 (self.tool.GetTestWrapper(), |
| 84 constants.TEST_EXECUTABLE_DIR, | 88 constants.TEST_EXECUTABLE_DIR, |
| 85 self.test_suite_basename)) | 89 self.test_suite_basename)) |
| 86 return self._ParseGTestListTests(all_tests) | 90 return self._ParseGTestListTests(all_tests) |
| 87 | 91 |
| 88 def CreateTestRunnerScript(self, gtest_filter, test_arguments): | 92 def CreateTestRunnerScript(self, gtest_filter, test_arguments): |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 os.makedirs(self.symbols_dir) | 157 os.makedirs(self.symbols_dir) |
| 154 shutil.copy(self.test_suite, self.symbols_dir) | 158 shutil.copy(self.test_suite, self.symbols_dir) |
| 155 strip = os.environ['STRIP'] | 159 strip = os.environ['STRIP'] |
| 156 cmd_helper.RunCmd([strip, self.test_suite, '-o', target_name]) | 160 cmd_helper.RunCmd([strip, self.test_suite, '-o', target_name]) |
| 157 test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.test_suite_basename | 161 test_binary = constants.TEST_EXECUTABLE_DIR + '/' + self.test_suite_basename |
| 158 self.adb.PushIfNeeded(target_name, test_binary) | 162 self.adb.PushIfNeeded(target_name, test_binary) |
| 159 | 163 |
| 160 def _GetTestSuiteBaseName(self): | 164 def _GetTestSuiteBaseName(self): |
| 161 """Returns the base name of the test suite.""" | 165 """Returns the base name of the test suite.""" |
| 162 return os.path.basename(self.test_suite) | 166 return os.path.basename(self.test_suite) |
| OLD | NEW |