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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 # Copy logic from tools/build/scripts/slave/runtest.py. | 178 # Copy logic from tools/build/scripts/slave/runtest.py. |
179 asan = '--asan=1' in cmd | 179 asan = '--asan=1' in cmd |
180 lsan = '--lsan=1' in cmd | 180 lsan = '--lsan=1' in cmd |
181 msan = '--msan=1' in cmd | 181 msan = '--msan=1' in cmd |
182 tsan = '--tsan=1' in cmd | 182 tsan = '--tsan=1' in cmd |
183 use_symbolization_script = (asan or msan) and not lsan | 183 use_symbolization_script = (asan or msan) and not lsan |
184 | 184 |
185 if asan or lsan or msan or tsan: | 185 if asan or lsan or msan or tsan: |
186 extra_env.update(get_sanitizer_env(cmd, asan, lsan, msan, tsan)) | 186 extra_env.update(get_sanitizer_env(cmd, asan, lsan, msan, tsan)) |
187 | 187 |
188 if lsan or tsan or (asan and sys.platform == 'win32'): | 188 if lsan or tsan: |
189 # ASan is not yet sandbox-friendly on Windows (http://crbug.com/382867). | 189 # LSan and TSan are not sandbox-friendly. |
190 # LSan and TSan are not sandbox-friendly. | 190 cmd.append('--no-sandbox') |
191 cmd.append('--no-sandbox') | |
192 | 191 |
193 cmd = trim_cmd(cmd) | 192 cmd = trim_cmd(cmd) |
194 | 193 |
195 # Ensure paths are correctly separated on windows. | 194 # Ensure paths are correctly separated on windows. |
196 cmd[0] = cmd[0].replace('/', os.path.sep) | 195 cmd[0] = cmd[0].replace('/', os.path.sep) |
197 cmd = fix_python_path(cmd) | 196 cmd = fix_python_path(cmd) |
198 | 197 |
199 print('Additional test environment:\n%s\n' | 198 print('Additional test environment:\n%s\n' |
200 'Command: %s\n' % ( | 199 'Command: %s\n' % ( |
201 '\n'.join(' %s=%s' % | 200 '\n'.join(' %s=%s' % |
(...skipping 20 matching lines...) Expand all Loading... |
222 print >> sys.stderr, 'Failed to start %s' % cmd | 221 print >> sys.stderr, 'Failed to start %s' % cmd |
223 raise | 222 raise |
224 | 223 |
225 | 224 |
226 def main(): | 225 def main(): |
227 return run_executable(sys.argv[1:], os.environ.copy()) | 226 return run_executable(sys.argv[1:], os.environ.copy()) |
228 | 227 |
229 | 228 |
230 if __name__ == '__main__': | 229 if __name__ == '__main__': |
231 sys.exit(main()) | 230 sys.exit(main()) |
OLD | NEW |