diff options
Diffstat (limited to 'testing/tools/common.py')
-rwxr-xr-x | testing/tools/common.py | 20 |
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' |