Chromium Code Reviews| 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 """Defines TestPackageExecutable to help run stand-alone executables.""" | 5 """Defines TestPackageExecutable to help run stand-alone executables.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import posixpath | 9 import posixpath |
| 10 import sys | 10 import sys |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 logging.info('Conents of the test runner script: ') | 109 logging.info('Conents of the test runner script: ') |
| 110 for line in open(sh_script_file.name).readlines(): | 110 for line in open(sh_script_file.name).readlines(): |
| 111 logging.info(' ' + line.rstrip()) | 111 logging.info(' ' + line.rstrip()) |
| 112 | 112 |
| 113 #override | 113 #override |
| 114 def GetAllTests(self, device): | 114 def GetAllTests(self, device): |
| 115 lib_path = posixpath.join( | 115 lib_path = posixpath.join( |
| 116 constants.TEST_EXECUTABLE_DIR, '%s_deps' % self.suite_name) | 116 constants.TEST_EXECUTABLE_DIR, '%s_deps' % self.suite_name) |
| 117 | 117 |
| 118 cmd = [] | 118 cmd = [] |
| 119 for wrapper in (device.GetDevicePieWrapper(), self.tool.GetTestWrapper()): | 119 for wrapper in (self.tool.GetTestWrapper()): |
|
aurimas (slooooooooow)
2015/05/11 17:45:23
Should I simplify this remove this for loop?
jbudorick
2015/05/11 17:49:41
Yeah, that'd be great.
| |
| 120 if wrapper: | 120 if wrapper: |
| 121 cmd.append(wrapper) | 121 cmd.append(wrapper) |
| 122 cmd.extend([ | 122 cmd.extend([ |
| 123 posixpath.join(constants.TEST_EXECUTABLE_DIR, self.suite_name), | 123 posixpath.join(constants.TEST_EXECUTABLE_DIR, self.suite_name), |
| 124 '--gtest_list_tests']) | 124 '--gtest_list_tests']) |
| 125 | 125 |
| 126 output = device.RunShellCommand( | 126 output = device.RunShellCommand( |
| 127 cmd, check_return=True, env={'LD_LIBRARY_PATH': lib_path}) | 127 cmd, check_return=True, env={'LD_LIBRARY_PATH': lib_path}) |
| 128 return gtest_test_instance.ParseGTestListTests(output) | 128 return gtest_test_instance.ParseGTestListTests(output) |
| 129 | 129 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 151 'stripped binary (%s, timestamp %d) older than ' | 151 'stripped binary (%s, timestamp %d) older than ' |
| 152 'source binary (%s, timestamp %d), build target %s' % | 152 'source binary (%s, timestamp %d), build target %s' % |
| 153 (target_name, target_mtime, self.suite_path, source_mtime, | 153 (target_name, target_mtime, self.suite_path, source_mtime, |
| 154 self.suite_name + '_stripped')) | 154 self.suite_name + '_stripped')) |
| 155 | 155 |
| 156 test_binary_path = constants.TEST_EXECUTABLE_DIR + '/' + self.suite_name | 156 test_binary_path = constants.TEST_EXECUTABLE_DIR + '/' + self.suite_name |
| 157 device.PushChangedFiles([(target_name, test_binary_path)]) | 157 device.PushChangedFiles([(target_name, test_binary_path)]) |
| 158 deps_path = self.suite_path + '_deps' | 158 deps_path = self.suite_path + '_deps' |
| 159 if os.path.isdir(deps_path): | 159 if os.path.isdir(deps_path): |
| 160 device.PushChangedFiles([(deps_path, test_binary_path + '_deps')]) | 160 device.PushChangedFiles([(deps_path, test_binary_path + '_deps')]) |
| OLD | NEW |