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 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 if not self.handle_uninits_and_leaks: | 873 if not self.handle_uninits_and_leaks: |
874 proc += ["-no_check_uninitialized", "-no_count_leaks"] | 874 proc += ["-no_check_uninitialized", "-no_count_leaks"] |
875 | 875 |
876 proc += self._tool_flags | 876 proc += self._tool_flags |
877 | 877 |
878 # Dr.Memory requires -- to separate tool flags from the executable name. | 878 # Dr.Memory requires -- to separate tool flags from the executable name. |
879 proc += ["--"] | 879 proc += ["--"] |
880 | 880 |
881 if self._options.indirect: | 881 if self._options.indirect: |
882 # TODO(timurrrr): reuse for TSan on Windows | 882 # TODO(timurrrr): reuse for TSan on Windows |
883 self.CreateBrowserWrapper(" ".join( | 883 wrapper_path = os.path.join(self._source_dir, |
884 ["python", "tools/valgrind/browser_wrapper_win.py"] + proc)) | 884 "tools", "valgrind", "browser_wrapper_win.py") |
| 885 self.CreateBrowserWrapper(" ".join(["python", wrapper_path] + proc)) |
885 proc = [] | 886 proc = [] |
886 | 887 |
887 # Note that self._args begins with the name of the exe to be run. | 888 # Note that self._args begins with the name of the exe to be run. |
888 self._args[0] = common.NormalizeWindowsPath(self._args[0]) | 889 self._args[0] = common.NormalizeWindowsPath(self._args[0]) |
889 proc += self._args | 890 proc += self._args |
890 return proc | 891 return proc |
891 | 892 |
892 def CreateBrowserWrapper(self, command): | 893 def CreateBrowserWrapper(self, command): |
893 os.putenv("BROWSER_WRAPPER", command) | 894 os.putenv("BROWSER_WRAPPER", command) |
894 | 895 |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 platform_name = sys.platform + "(Unknown)" | 1186 platform_name = sys.platform + "(Unknown)" |
1186 raise RuntimeError, "Unknown tool (tool=%s, platform=%s)" % (tool_name, | 1187 raise RuntimeError, "Unknown tool (tool=%s, platform=%s)" % (tool_name, |
1187 platform_name) | 1188 platform_name) |
1188 | 1189 |
1189 def CreateTool(tool): | 1190 def CreateTool(tool): |
1190 return ToolFactory().Create(tool) | 1191 return ToolFactory().Create(tool) |
1191 | 1192 |
1192 if __name__ == '__main__': | 1193 if __name__ == '__main__': |
1193 logging.error(sys.argv[0] + " can not be run from command line") | 1194 logging.error(sys.argv[0] + " can not be run from command line") |
1194 sys.exit(1) | 1195 sys.exit(1) |
OLD | NEW |