Chromium Code Reviews| 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 # valgrind_test.py | 6 # valgrind_test.py |
| 7 | 7 |
| 8 '''Runs an exe through Valgrind and puts the intermediate files in a | 8 '''Runs an exe through Valgrind and puts the intermediate files in a |
| 9 directory. | 9 directory. |
| 10 ''' | 10 ''' |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 shutil.copyfile(dsym_file, test_command) | 178 shutil.copyfile(dsym_file, test_command) |
| 179 shutil.copymode(saved_test_command, test_command) | 179 shutil.copymode(saved_test_command, test_command) |
| 180 | 180 |
| 181 if needs_dsymutil: | 181 if needs_dsymutil: |
| 182 if self._options.generate_dsym: | 182 if self._options.generate_dsym: |
| 183 # Remove the .dSYM bundle if it exists. | 183 # Remove the .dSYM bundle if it exists. |
| 184 shutil.rmtree(dsym_bundle, True) | 184 shutil.rmtree(dsym_bundle, True) |
| 185 | 185 |
| 186 dsymutil_command = ['dsymutil', test_command] | 186 dsymutil_command = ['dsymutil', test_command] |
| 187 | 187 |
| 188 # dsymutil is crazy slow. Let it run for up to a half hour. I hope | 188 # dsymutil is crazy slow. Ideally we'd have a timeout here, |
| 189 # that's enough. | 189 # but common.RunSubprocess' timeout is only checked |
| 190 common.RunSubprocess(dsymutil_command, 30 * 60) | 190 # after each line of output; dsymutil is silent |
| 191 # until the end, and is then killed, which is silly. | |
| 192 common.RunSubprocess(dsymutil_command, 0) | |
|
Nico
2009/07/22 15:34:32
Uber-nit: I'd either leave out the ', 0' (it's the
| |
| 191 | 193 |
| 192 if saved_test_command: | 194 if saved_test_command: |
| 193 os.rename(saved_test_command, test_command) | 195 os.rename(saved_test_command, test_command) |
| 194 else: | 196 else: |
| 195 logging.info("No real .dSYM for test_command. Line numbers will " | 197 logging.info("No real .dSYM for test_command. Line numbers will " |
| 196 "not be shown. Either tell xcode to generate .dSYM " | 198 "not be shown. Either tell xcode to generate .dSYM " |
| 197 "file, or use --generate_dsym option to this tool.") | 199 "file, or use --generate_dsym option to this tool.") |
| 198 | 200 |
| 199 def ValgrindCommand(self): | 201 def ValgrindCommand(self): |
| 200 """Get the valgrind command to run.""" | 202 """Get the valgrind command to run.""" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 | 454 |
| 453 if __name__ == "__main__": | 455 if __name__ == "__main__": |
| 454 if sys.argv.count("-v") > 0 or sys.argv.count("--verbose") > 0: | 456 if sys.argv.count("-v") > 0 or sys.argv.count("--verbose") > 0: |
| 455 google.logging_utils.config_root(logging.DEBUG) | 457 google.logging_utils.config_root(logging.DEBUG) |
| 456 else: | 458 else: |
| 457 google.logging_utils.config_root() | 459 google.logging_utils.config_root() |
| 458 # TODO(timurrrr): valgrind tools may use -v/--verbose as well | 460 # TODO(timurrrr): valgrind tools may use -v/--verbose as well |
| 459 | 461 |
| 460 ret = RunTool(sys.argv) | 462 ret = RunTool(sys.argv) |
| 461 sys.exit(ret) | 463 sys.exit(ret) |
| OLD | NEW |