OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2006-2009 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 |
11 import logging | 11 import logging |
12 import os | 12 import os |
(...skipping 24 matching lines...) Expand all Loading... |
37 os.putenv(env_name, env_value) | 37 os.putenv(env_name, env_value) |
38 logging.info('export %s=%s', env_name, env_value) | 38 logging.info('export %s=%s', env_name, env_value) |
39 | 39 |
40 def Execute(self): | 40 def Execute(self): |
41 """Executes the app to be tested.""" | 41 """Executes the app to be tested.""" |
42 logging.info('starting execution...') | 42 logging.info('starting execution...') |
43 proc = ['sh', path_utils.ScriptDir() + '/heapcheck_std.sh'] | 43 proc = ['sh', path_utils.ScriptDir() + '/heapcheck_std.sh'] |
44 proc += self._args | 44 proc += self._args |
45 self.PutEnvAndLog('G_SLICE', 'always-malloc') | 45 self.PutEnvAndLog('G_SLICE', 'always-malloc') |
46 self.PutEnvAndLog('NSS_DISABLE_ARENA_FREE_LIST', '1') | 46 self.PutEnvAndLog('NSS_DISABLE_ARENA_FREE_LIST', '1') |
| 47 self.PutEnvAndLog('NSS_DISABLE_UNLOAD', '1') |
47 self.PutEnvAndLog('GTEST_DEATH_TEST_USE_FORK', '1') | 48 self.PutEnvAndLog('GTEST_DEATH_TEST_USE_FORK', '1') |
48 self.PutEnvAndLog('HEAPCHECK', self._mode) | 49 self.PutEnvAndLog('HEAPCHECK', self._mode) |
49 self.PutEnvAndLog('HEAP_CHECK_MAX_LEAKS', '-1') | 50 self.PutEnvAndLog('HEAP_CHECK_MAX_LEAKS', '-1') |
50 self.PutEnvAndLog('KEEP_SHADOW_STACKS', '1') | 51 self.PutEnvAndLog('KEEP_SHADOW_STACKS', '1') |
51 self.PutEnvAndLog('PPROF_PATH', | 52 self.PutEnvAndLog('PPROF_PATH', |
52 path_utils.ScriptDir() + | 53 path_utils.ScriptDir() + |
53 '/../../third_party/tcmalloc/chromium/src/pprof') | 54 '/../../third_party/tcmalloc/chromium/src/pprof') |
54 self.PutEnvAndLog('LD_PRELOAD', '/usr/lib/debug/libstdc++.so') | 55 self.PutEnvAndLog('LD_PRELOAD', '/usr/lib/debug/libstdc++.so') |
55 | 56 |
56 common.RunSubprocess(proc, self._timeout) | 57 common.RunSubprocess(proc, self._timeout) |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 'http://dev.chromium.org/developers/how-tos/' | 207 'http://dev.chromium.org/developers/how-tos/' |
207 'using-the-heap-leak-checker') | 208 'using-the-heap-leak-checker') |
208 return retcode | 209 return retcode |
209 | 210 |
210 | 211 |
211 def RunTool(args, supp_files, module): | 212 def RunTool(args, supp_files, module): |
212 tool = HeapcheckWrapper(supp_files) | 213 tool = HeapcheckWrapper(supp_files) |
213 MODULES_TO_SANITY_CHECK = ["base"] | 214 MODULES_TO_SANITY_CHECK = ["base"] |
214 check_sanity = module in MODULES_TO_SANITY_CHECK | 215 check_sanity = module in MODULES_TO_SANITY_CHECK |
215 return tool.Main(args[1:], check_sanity) | 216 return tool.Main(args[1:], check_sanity) |
OLD | NEW |