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 os | 6 import os |
7 import re | 7 import re |
8 import sys | 8 import sys |
9 | 9 |
10 import cmd_helper | 10 import cmd_helper |
(...skipping 30 matching lines...) Expand all Loading... |
41 TestPackage.__init__(self, adb, device, test_suite, timeout, | 41 TestPackage.__init__(self, adb, device, test_suite, timeout, |
42 rebaseline, performance_test, cleanup_test_files, | 42 rebaseline, performance_test, cleanup_test_files, |
43 tool, dump_debug_info) | 43 tool, dump_debug_info) |
44 | 44 |
45 def _CreateTestRunnerScript(self, options): | 45 def _CreateTestRunnerScript(self, options): |
46 command_line_file = tempfile.NamedTemporaryFile() | 46 command_line_file = tempfile.NamedTemporaryFile() |
47 # GTest expects argv[0] to be the executable path. | 47 # GTest expects argv[0] to be the executable path. |
48 command_line_file.write(self.test_suite_basename + ' ' + options) | 48 command_line_file.write(self.test_suite_basename + ' ' + options) |
49 command_line_file.flush() | 49 command_line_file.flush() |
50 self.adb.PushIfNeeded(command_line_file.name, | 50 self.adb.PushIfNeeded(command_line_file.name, |
51 constants.TEST_DATA_DIR + | 51 constants.TEST_EXECUTABLE_DIR + |
52 '/chrome-native-tests-command-line') | 52 '/chrome-native-tests-command-line') |
53 | 53 |
54 def _GetGTestReturnCode(self): | 54 def _GetGTestReturnCode(self): |
55 return None | 55 return None |
56 | 56 |
57 def GetAllTests(self): | 57 def GetAllTests(self): |
58 """Returns a list of all tests available in the test suite.""" | 58 """Returns a list of all tests available in the test suite.""" |
59 self._CreateTestRunnerScript('--gtest_list_tests') | 59 self._CreateTestRunnerScript('--gtest_list_tests') |
60 try: | 60 try: |
61 self.tool.SetupEnvironment() | 61 self.tool.SetupEnvironment() |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 def StripAndCopyExecutable(self): | 98 def StripAndCopyExecutable(self): |
99 # Always uninstall the previous one (by activity name); we don't | 99 # Always uninstall the previous one (by activity name); we don't |
100 # know what was embedded in it. | 100 # know what was embedded in it. |
101 self.adb.ManagedInstall(self.test_suite_full, False, | 101 self.adb.ManagedInstall(self.test_suite_full, False, |
102 package_name='org.chromium.native_test') | 102 package_name='org.chromium.native_test') |
103 | 103 |
104 def _GetTestSuiteBaseName(self): | 104 def _GetTestSuiteBaseName(self): |
105 """Returns the base name of the test suite.""" | 105 """Returns the base name of the test suite.""" |
106 # APK test suite names end with '-debug.apk' | 106 # APK test suite names end with '-debug.apk' |
107 return os.path.basename(self.test_suite).rsplit('-debug', 1)[0] | 107 return os.path.basename(self.test_suite).rsplit('-debug', 1)[0] |
OLD | NEW |