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

Side by Side Diff: build/toolchain/wrapper_utils.py

Issue 2617283002: Add Clang static analyzer to Clang toolchain defs in GN (Closed)
Patch Set: rebase Created 3 years, 10 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 | « build/toolchain/mac/BUILD.gn ('k') | docs/clang_static_analyzer.md » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Helper functions for gcc_toolchain.gni wrappers.""" 5 """Helper functions for gcc_toolchain.gni wrappers."""
6 6
7 import os 7 import os
8 import re 8 import re
9 import subprocess 9 import subprocess
10 import shlex 10 import shlex
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 lines = text.splitlines() 85 lines = text.splitlines()
86 for ln in lines: 86 for ln in lines:
87 match = _WHITELIST_RE.search(ln) 87 match = _WHITELIST_RE.search(ln)
88 if match: 88 if match:
89 resource_id = int(match.group('resource_id')) 89 resource_id = int(match.group('resource_id'))
90 used_resources.add(resource_id) 90 used_resources.add(resource_id)
91 91
92 return used_resources 92 return used_resources
93 93
94 94
95 def CaptureCommandStderr(command): 95 def CaptureCommandStderr(command, env=None):
96 """Returns the stderr of a command. 96 """Returns the stderr of a command.
97 97
98 Args: 98 Args:
99 args: A list containing the command and arguments. 99 command: A list containing the command and arguments.
100 cwd: The working directory from where the command should be made.
101 env: Environment variables for the new process. 100 env: Environment variables for the new process.
102 """ 101 """
103 child = subprocess.Popen(command, stderr=subprocess.PIPE) 102 child = subprocess.Popen(command, stderr=subprocess.PIPE, env=env)
104 _, stderr = child.communicate() 103 _, stderr = child.communicate()
105 return child.returncode, stderr 104 return child.returncode, stderr
OLDNEW
« no previous file with comments | « build/toolchain/mac/BUILD.gn ('k') | docs/clang_static_analyzer.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698