| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # chrome_tests.py | 6 # chrome_tests.py |
| 7 | 7 |
| 8 ''' Runs various chrome tests through valgrind_test.py. | 8 ''' Runs various chrome tests through valgrind_test.py. |
| 9 | 9 |
| 10 This file is a copy of ../purify/chrome_tests.py. Eventually, it would be nice | 10 This file is a copy of ../purify/chrome_tests.py. Eventually, it would be nice |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 self._data_dirs = [google.path_utils.ScriptDir()] | 87 self._data_dirs = [google.path_utils.ScriptDir()] |
| 88 | 88 |
| 89 if module == "chrome": | 89 if module == "chrome": |
| 90 # unfortunately, not all modules have the same directory structure | 90 # unfortunately, not all modules have the same directory structure |
| 91 self._data_dirs.append(os.path.join(module_dir, "test", "data", | 91 self._data_dirs.append(os.path.join(module_dir, "test", "data", |
| 92 "valgrind")) | 92 "valgrind")) |
| 93 else: | 93 else: |
| 94 self._data_dirs.append(os.path.join(module_dir, "data", "valgrind")) | 94 self._data_dirs.append(os.path.join(module_dir, "data", "valgrind")) |
| 95 | 95 |
| 96 if not self._options.build_dir: | 96 if not self._options.build_dir: |
| 97 dir_chrome = os.path.join(self._source_dir, "sconsbuild", "Debug") | 97 builddir = { |
| 98 'darwin': 'xcodebuild', |
| 99 'linux2': 'sconsbuild' |
| 100 }[sys.platform] |
| 101 dir_chrome = os.path.join(self._source_dir, builddir, "Debug") |
| 98 dir_module = os.path.join(module_dir, "Debug") | 102 dir_module = os.path.join(module_dir, "Debug") |
| 99 if exe: | 103 if exe: |
| 100 exe_chrome = os.path.join(dir_chrome, exe) | 104 exe_chrome = os.path.join(dir_chrome, exe) |
| 101 exe_module = os.path.join(dir_module, exe) | 105 exe_module = os.path.join(dir_module, exe) |
| 102 if os.path.isfile(exe_chrome) and not os.path.isfile(exe_module): | 106 if os.path.isfile(exe_chrome) and not os.path.isfile(exe_module): |
| 103 self._options.build_dir = dir_chrome | 107 self._options.build_dir = dir_chrome |
| 104 elif os.path.isfile(exe_module) and not os.path.isfile(exe_chrome): | 108 elif os.path.isfile(exe_module) and not os.path.isfile(exe_chrome): |
| 105 self._options.build_dir = dir_module | 109 self._options.build_dir = dir_module |
| 106 elif (os.stat(exe_module)[stat.ST_MTIME] > | 110 elif (os.stat(exe_module)[stat.ST_MTIME] > |
| 107 os.stat(exe_chrome)[stat.ST_MTIME]): | 111 os.stat(exe_chrome)[stat.ST_MTIME]): |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 for t in options.test: | 392 for t in options.test: |
| 389 tests = ChromeTests(options, args, t) | 393 tests = ChromeTests(options, args, t) |
| 390 ret = tests.Run() | 394 ret = tests.Run() |
| 391 if ret: return ret | 395 if ret: return ret |
| 392 return 0 | 396 return 0 |
| 393 | 397 |
| 394 | 398 |
| 395 if __name__ == "__main__": | 399 if __name__ == "__main__": |
| 396 ret = _main(sys.argv) | 400 ret = _main(sys.argv) |
| 397 sys.exit(ret) | 401 sys.exit(ret) |
| OLD | NEW |