| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 ''' Runs various chrome tests through heapcheck_test.py. | 7 ''' Runs various chrome tests through heapcheck_test.py. |
| 8 | 8 |
| 9 Most of this code is copied from ../valgrind/chrome_tests.py. | 9 Most of this code is copied from ../valgrind/chrome_tests.py. |
| 10 TODO(glider): put common functions to a standalone module. | 10 TODO(glider): put common functions to a standalone module. |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 if module == "chrome": | 140 if module == "chrome": |
| 141 # Unfortunately, not all modules have the same directory structure. | 141 # Unfortunately, not all modules have the same directory structure. |
| 142 self._data_dirs.append(os.path.join(module_dir, "test", "data", | 142 self._data_dirs.append(os.path.join(module_dir, "test", "data", |
| 143 "heapcheck")) | 143 "heapcheck")) |
| 144 else: | 144 else: |
| 145 self._data_dirs.append(os.path.join(module_dir, "data", "heapcheck")) | 145 self._data_dirs.append(os.path.join(module_dir, "data", "heapcheck")) |
| 146 | 146 |
| 147 if not self._options.build_dir: | 147 if not self._options.build_dir: |
| 148 dirs = [ | 148 dirs = [ |
| 149 os.path.join(self._source_dir, "xcodebuild", "Debug"), | 149 os.path.join(self._source_dir, "xcodebuild", "Debug"), |
| 150 os.path.join(self._source_dir, "sconsbuild", "Debug"), | |
| 151 os.path.join(self._source_dir, "out", "Debug"), | 150 os.path.join(self._source_dir, "out", "Debug"), |
| 152 ] | 151 ] |
| 153 if exe: | 152 if exe: |
| 154 self._options.build_dir = FindDirContainingNewestFile(dirs, exe) | 153 self._options.build_dir = FindDirContainingNewestFile(dirs, exe) |
| 155 else: | 154 else: |
| 156 self._options.build_dir = FindNewestDir(dirs) | 155 self._options.build_dir = FindNewestDir(dirs) |
| 157 | 156 |
| 158 cmd = list(self._command_preamble) | 157 cmd = list(self._command_preamble) |
| 159 | 158 |
| 160 if heapcheck_test_args != None: | 159 if heapcheck_test_args != None: |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 return 0 | 446 return 0 |
| 448 | 447 |
| 449 | 448 |
| 450 if __name__ == "__main__": | 449 if __name__ == "__main__": |
| 451 if sys.platform == 'linux2': | 450 if sys.platform == 'linux2': |
| 452 ret = _main(sys.argv) | 451 ret = _main(sys.argv) |
| 453 else: | 452 else: |
| 454 logging.error("Heap checking works only on Linux at the moment.") | 453 logging.error("Heap checking works only on Linux at the moment.") |
| 455 ret = 1 | 454 ret = 1 |
| 456 sys.exit(ret) | 455 sys.exit(ret) |
| OLD | NEW |