summaryrefslogtreecommitdiff
path: root/testing/tools/common.py
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2017-08-09 16:43:25 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-10 17:40:32 +0000
commitd9b0dac5e78795fa916c163fac385182fc9ceea9 (patch)
tree16518f182f03f32829b1c32aa7f7143b2fc7bff3 /testing/tools/common.py
parent7e805d1a6f3bf7ddd04b2c1ce857a2cf6d9ff873 (diff)
downloadpdfium-d9b0dac5e78795fa916c163fac385182fc9ceea9.tar.xz
Extracting GetBooleanGnArg from coverage_report.py
Change-Id: I5475b37aad69361e2e7fae4ce69faf011e3b5c40 Reviewed-on: https://pdfium-review.googlesource.com/10030 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'testing/tools/common.py')
-rwxr-xr-xtesting/tools/common.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/testing/tools/common.py b/testing/tools/common.py
index c3bc2181f4..737169f8d3 100755
--- a/testing/tools/common.py
+++ b/testing/tools/common.py
@@ -99,12 +99,14 @@ class DirectoryFinder:
return result
-def GetBooleanGnArg(arg_name, build_dir):
- '''Extract the value of a boolean flag in args.gn'''
- cwd = os.getcwd()
- os.chdir(build_dir)
- gn_args_output = subprocess.check_output(
- ['gn', 'args', '.', '--list=%s' % arg_name, '--short'])
- os.chdir(cwd)
- arg_match_output = re.search('%s = (.*)' % arg_name, gn_args_output).group(1)
- return arg_match_output == 'true'
+def GetBooleanGnArg(arg_name, build_dir, verbose=False):
+ '''Extract the value of a boolean flag in args.gn'''
+ cwd = os.getcwd()
+ os.chdir(build_dir)
+ gn_args_output = subprocess.check_output(
+ ['gn', 'args', '.', '--list=%s' % arg_name, '--short'])
+ os.chdir(cwd)
+ arg_match_output = re.search('%s = (.*)' % arg_name, gn_args_output).group(1)
+ if verbose:
+ print >> sys.stderr, "Found '%s' for value of %s" % (arg_match_output, arg)
+ return arg_match_output == 'true'