| 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 # heapcheck_test.py | 6 # heapcheck_test.py |
| 7 | 7 |
| 8 """Wrapper for running the test under heapchecker and analyzing the output.""" | 8 """Wrapper for running the test under heapchecker and analyzing the output.""" |
| 9 | 9 |
| 10 import datetime | 10 import datetime |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 self.PutEnvAndLog('KEEP_SHADOW_STACKS', '1') | 51 self.PutEnvAndLog('KEEP_SHADOW_STACKS', '1') |
| 52 self.PutEnvAndLog('PPROF_PATH', | 52 self.PutEnvAndLog('PPROF_PATH', |
| 53 path_utils.ScriptDir() + | 53 path_utils.ScriptDir() + |
| 54 '/../../third_party/tcmalloc/chromium/src/pprof') | 54 '/../../third_party/tcmalloc/chromium/src/pprof') |
| 55 self.PutEnvAndLog('LD_LIBRARY_PATH', | 55 self.PutEnvAndLog('LD_LIBRARY_PATH', |
| 56 '/usr/lib/debug/:/usr/lib32/debug/') | 56 '/usr/lib/debug/:/usr/lib32/debug/') |
| 57 | 57 |
| 58 common.RunSubprocess(proc, self._timeout) | 58 common.RunSubprocess(proc, self._timeout) |
| 59 | 59 |
| 60 # Always return true, even if running the subprocess failed. We depend on | 60 # Always return true, even if running the subprocess failed. We depend on |
| 61 # Analyze to determine if the run was valid. (This behaviour copied from | 61 # Analyze to determine if the run was valid. |
| 62 # the purify_test.py script.) | |
| 63 return True | 62 return True |
| 64 | 63 |
| 65 def Analyze(self, log_lines, check_sanity=False): | 64 def Analyze(self, log_lines, check_sanity=False): |
| 66 """Analyzes the app's output and applies suppressions to the reports. | 65 """Analyzes the app's output and applies suppressions to the reports. |
| 67 | 66 |
| 68 Analyze() searches the logs for leak reports and tries to apply | 67 Analyze() searches the logs for leak reports and tries to apply |
| 69 suppressions to them. Unsuppressed reports and other log messages are | 68 suppressions to them. Unsuppressed reports and other log messages are |
| 70 dumped as is. | 69 dumped as is. |
| 71 | 70 |
| 72 If |check_sanity| is True, the list of suppressed reports is searched for a | 71 If |check_sanity| is True, the list of suppressed reports is searched for a |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 'http://dev.chromium.org/developers/how-tos/' | 207 'http://dev.chromium.org/developers/how-tos/' |
| 209 'using-the-heap-leak-checker') | 208 'using-the-heap-leak-checker') |
| 210 return retcode | 209 return retcode |
| 211 | 210 |
| 212 | 211 |
| 213 def RunTool(args, supp_files, module): | 212 def RunTool(args, supp_files, module): |
| 214 tool = HeapcheckWrapper(supp_files) | 213 tool = HeapcheckWrapper(supp_files) |
| 215 MODULES_TO_SANITY_CHECK = ["base"] | 214 MODULES_TO_SANITY_CHECK = ["base"] |
| 216 check_sanity = module in MODULES_TO_SANITY_CHECK | 215 check_sanity = module in MODULES_TO_SANITY_CHECK |
| 217 return tool.Main(args[1:], check_sanity) | 216 return tool.Main(args[1:], check_sanity) |
| OLD | NEW |