Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Side by Side Diff: testing/test_env.py

Issue 639713009: Pass extra env variables also to the symbolizer script. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 (k, v) for k, v in sorted(extra_env.iteritems())), 167 (k, v) for k, v in sorted(extra_env.iteritems())),
168 ' '.join(cmd))) 168 ' '.join(cmd)))
169 env.update(extra_env or {}) 169 env.update(extra_env or {})
170 try: 170 try:
171 # See above comment regarding offline symbolization. 171 # See above comment regarding offline symbolization.
172 if asan and not lsan: 172 if asan and not lsan:
173 # Need to pipe to the symbolizer script. 173 # Need to pipe to the symbolizer script.
174 p1 = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE, 174 p1 = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE,
175 stderr=sys.stdout) 175 stderr=sys.stdout)
176 p2 = subprocess.Popen(["../tools/valgrind/asan/asan_symbolize.py"], 176 p2 = subprocess.Popen(["../tools/valgrind/asan/asan_symbolize.py"],
177 stdin=p1.stdout) 177 env=env, stdin=p1.stdout)
178 p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits. 178 p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits.
179 p1.wait()
179 p2.wait() 180 p2.wait()
180 return p2.returncode 181 return p1.returncode
181 else: 182 else:
182 return subprocess.call(cmd, env=env) 183 return subprocess.call(cmd, env=env)
183 except OSError: 184 except OSError:
184 print >> sys.stderr, 'Failed to start %s' % cmd 185 print >> sys.stderr, 'Failed to start %s' % cmd
185 raise 186 raise
186 187
187 188
188 def main(): 189 def main():
189 return run_executable(sys.argv[1:], os.environ.copy()) 190 return run_executable(sys.argv[1:], os.environ.copy())
190 191
191 192
192 if __name__ == '__main__': 193 if __name__ == '__main__':
193 sys.exit(main()) 194 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698