OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 "in the tool-specific subclass" | 53 "in the tool-specific subclass" |
54 | 54 |
55 def RegisterOptionParserHook(self, hook): | 55 def RegisterOptionParserHook(self, hook): |
56 # Frameworks and tools can add their own flags to the parser. | 56 # Frameworks and tools can add their own flags to the parser. |
57 self.option_parser_hooks.append(hook) | 57 self.option_parser_hooks.append(hook) |
58 | 58 |
59 def CreateOptionParser(self): | 59 def CreateOptionParser(self): |
60 # Defines Chromium-specific flags. | 60 # Defines Chromium-specific flags. |
61 self._parser = optparse.OptionParser("usage: %prog [options] <program to " | 61 self._parser = optparse.OptionParser("usage: %prog [options] <program to " |
62 "test>") | 62 "test>") |
| 63 self._parser.disable_interspersed_args() |
63 self._parser.add_option("-t", "--timeout", | 64 self._parser.add_option("-t", "--timeout", |
64 dest="timeout", metavar="TIMEOUT", default=10000, | 65 dest="timeout", metavar="TIMEOUT", default=10000, |
65 help="timeout in seconds for the run (default 10000)") | 66 help="timeout in seconds for the run (default 10000)") |
66 self._parser.add_option("", "--source_dir", | 67 self._parser.add_option("", "--source_dir", |
67 help="path to top of source tree for this build" | 68 help="path to top of source tree for this build" |
68 "(used to normalize source paths in baseline)") | 69 "(used to normalize source paths in baseline)") |
69 self._parser.add_option("", "--gtest_filter", default="", | 70 self._parser.add_option("", "--gtest_filter", default="", |
70 help="which test case to run") | 71 help="which test case to run") |
71 self._parser.add_option("", "--gtest_repeat", | 72 self._parser.add_option("", "--gtest_repeat", |
72 help="how many times to run each test") | 73 help="how many times to run each test") |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 platform_name = sys.platform + "(Unknown)" | 980 platform_name = sys.platform + "(Unknown)" |
980 raise RuntimeError, "Unknown tool (tool=%s, platform=%s)" % (tool_name, | 981 raise RuntimeError, "Unknown tool (tool=%s, platform=%s)" % (tool_name, |
981 platform_name) | 982 platform_name) |
982 | 983 |
983 def CreateTool(tool): | 984 def CreateTool(tool): |
984 return ToolFactory().Create(tool) | 985 return ToolFactory().Create(tool) |
985 | 986 |
986 if __name__ == '__main__': | 987 if __name__ == '__main__': |
987 logging.error(sys.argv[0] + " can not be run from command line") | 988 logging.error(sys.argv[0] + " can not be run from command line") |
988 sys.exit(1) | 989 sys.exit(1) |
OLD | NEW |