| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Sets environment variables needed to run a chromium unit test.""" | 6 """Sets environment variables needed to run a chromium unit test.""" |
| 7 | 7 |
| 8 import os | 8 import os |
| 9 import stat | 9 import stat |
| 10 import subprocess | 10 import subprocess |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 if lsan: | 101 if lsan: |
| 102 if asan or msan: | 102 if asan or msan: |
| 103 lsan_options = [] | 103 lsan_options = [] |
| 104 else: | 104 else: |
| 105 lsan_options = symbolization_options[:] | 105 lsan_options = symbolization_options[:] |
| 106 if sys.platform == 'linux2': | 106 if sys.platform == 'linux2': |
| 107 # Use the debug version of libstdc++ under LSan. If we don't, there will | 107 # Use the debug version of libstdc++ under LSan. If we don't, there will |
| 108 # be a lot of incomplete stack traces in the reports. | 108 # be a lot of incomplete stack traces in the reports. |
| 109 extra_env['LD_LIBRARY_PATH'] = '/usr/lib/x86_64-linux-gnu/debug:' | 109 extra_env['LD_LIBRARY_PATH'] = '/usr/lib/x86_64-linux-gnu/debug:' |
| 110 | 110 |
| 111 suppressions_file = os.path.join(ROOT_DIR, 'tools', 'lsan', |
| 112 'suppressions.txt') |
| 113 lsan_options += ['suppressions=%s' % suppressions_file, |
| 114 'print_suppressions=1'] |
| 111 extra_env['LSAN_OPTIONS'] = ' '.join(lsan_options) | 115 extra_env['LSAN_OPTIONS'] = ' '.join(lsan_options) |
| 112 | 116 |
| 113 if msan: | 117 if msan: |
| 114 msan_options = symbolization_options[:] | 118 msan_options = symbolization_options[:] |
| 115 if lsan: | 119 if lsan: |
| 116 msan_options.append('detect_leaks=1') | 120 msan_options.append('detect_leaks=1') |
| 117 extra_env['MSAN_OPTIONS'] = ' '.join(msan_options) | 121 extra_env['MSAN_OPTIONS'] = ' '.join(msan_options) |
| 118 | 122 |
| 119 if tsan: | 123 if tsan: |
| 120 tsan_options = symbolization_options[:] | 124 tsan_options = symbolization_options[:] |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 print >> sys.stderr, 'Failed to start %s' % cmd | 234 print >> sys.stderr, 'Failed to start %s' % cmd |
| 231 raise | 235 raise |
| 232 | 236 |
| 233 | 237 |
| 234 def main(): | 238 def main(): |
| 235 return run_executable(sys.argv[1:], os.environ.copy()) | 239 return run_executable(sys.argv[1:], os.environ.copy()) |
| 236 | 240 |
| 237 | 241 |
| 238 if __name__ == '__main__': | 242 if __name__ == '__main__': |
| 239 sys.exit(main()) | 243 sys.exit(main()) |
| OLD | NEW |