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

Unified Diff: build/landmines.py

Issue 23604016: Make landmines.py take an extra script via an env var. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace fix Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/landmines.py
diff --git a/build/landmines.py b/build/landmines.py
index f1a514c5e7e206c345a33febea6b3d840781999e..91b4fa9e60d8c6ab9490e2205af8524cbd97b915 100755
--- a/build/landmines.py
+++ b/build/landmines.py
@@ -83,13 +83,15 @@ def set_up_landmines(target, new_landmines):
os.remove(triggered)
-def main():
+def process_options():
+ """Returns a list of landmine emitting scripts."""
parser = optparse.OptionParser()
parser.add_option(
'-s', '--landmine-scripts', action='append',
default=[os.path.join(SRC_DIR, 'build', 'get_landmines.py')],
help='Path to the script which emits landmines to stdout. The target '
- 'is passed to this script via option -t.')
+ 'is passed to this script via option -t. Note that an extra '
+ 'script can be specified via an env var EXTRA_LANDMINES_SCRIPT.')
parser.add_option('-v', '--verbose', action='store_true',
default=('LANDMINES_VERBOSE' in os.environ),
help=('Emit some extra debugging information (default off). This option '
@@ -104,11 +106,20 @@ def main():
logging.basicConfig(
level=logging.DEBUG if options.verbose else logging.ERROR)
+ extra_script = os.environ.get('EXTRA_LANDMINES_SCRIPT')
+ if extra_script:
+ return options.landmine_scripts + [extra_script]
+ else:
+ return options.landmine_scripts
+
+
+def main():
+ landmine_scripts = process_options()
gyp_helper.apply_chromium_gyp_env()
for target in ('Debug', 'Release', 'Debug_x64', 'Release_x64'):
landmines = []
- for s in options.landmine_scripts:
+ for s in landmine_scripts:
proc = subprocess.Popen([sys.executable, s, '-t', target],
stdout=subprocess.PIPE)
output, _ = proc.communicate()
« 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