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 ''' |
11 | 11 |
12 import datetime | 12 import datetime |
13 import glob | 13 import glob |
14 import logging | 14 import logging |
15 import optparse | 15 import optparse |
16 import os | 16 import os |
17 import re | 17 import re |
18 import shutil | 18 import shutil |
19 import stat | 19 import stat |
20 import sys | 20 import sys |
21 import tempfile | 21 import tempfile |
22 import time | 22 import time |
23 | 23 |
24 import common | 24 import common |
25 | 25 |
26 import memcheck_analyze | 26 import memcheck_analyze |
27 import tsan_analyze | 27 import tsan_analyze |
28 | 28 |
29 import google.logging_utils | 29 import logging_utils |
30 | 30 |
31 class ValgrindTool(object): | 31 class ValgrindTool(object): |
32 | 32 |
33 """Abstract class for running Valgrind. | 33 """Abstract class for running Valgrind. |
34 | 34 |
35 Always subclass this and implement ValgrindCommand() with platform specific | 35 Always subclass this and implement ValgrindCommand() with platform specific |
36 stuff. | 36 stuff. |
37 """ | 37 """ |
38 | 38 |
39 TMP_DIR = "valgrind.tmp" | 39 TMP_DIR = "valgrind.tmp" |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 args.remove(arg) | 557 args.remove(arg) |
558 break | 558 break |
559 | 559 |
560 tool = ToolFactory().Create(tool_name) | 560 tool = ToolFactory().Create(tool_name) |
561 MODULES_TO_SANITY_CHECK = ["base"] | 561 MODULES_TO_SANITY_CHECK = ["base"] |
562 check_sanity = module in MODULES_TO_SANITY_CHECK | 562 check_sanity = module in MODULES_TO_SANITY_CHECK |
563 return tool.Main(args, check_sanity) | 563 return tool.Main(args, check_sanity) |
564 | 564 |
565 if __name__ == "__main__": | 565 if __name__ == "__main__": |
566 if sys.argv.count("-v") > 0 or sys.argv.count("--verbose") > 0: | 566 if sys.argv.count("-v") > 0 or sys.argv.count("--verbose") > 0: |
567 google.logging_utils.config_root(logging.DEBUG) | 567 logging_utils.config_root(logging.DEBUG) |
568 else: | 568 else: |
569 google.logging_utils.config_root() | 569 logging_utils.config_root() |
570 # TODO(timurrrr): valgrind tools may use -v/--verbose as well | 570 # TODO(timurrrr): valgrind tools may use -v/--verbose as well |
571 | 571 |
572 ret = RunTool(sys.argv) | 572 ret = RunTool(sys.argv) |
573 sys.exit(ret) | 573 sys.exit(ret) |
OLD | NEW |