Roll src/third_party/WebKit 86dee58:318ad17 (svn 202526:202527)
[chromium-blink-merge.git] / testing / scripts / gyp_flag_compare.py
blob0b777d9adb1e18c45836d46d4f972d6b6c001676
1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 """Wrap //tools/gn/bin/gyp_flag_compare.py for the bots.
8 This script wraps the GN test script in the facade needed for the
9 'ScriptTest' step class of the chromium recipe_module
10 (see scripts/slave/recipe_modules/chromium/steps.py in the build repo.
12 The script takes N arguments, for the N targets to compare flags for.
13 """
15 import json
16 import os
17 import sys
20 import common
23 def main_run(args):
24 rc = common.run_command([sys.executable,
25 os.path.join(common.SRC_DIR,
26 'tools', 'gn', 'bin',
27 'gyp_flag_compare.py')] + args.args)
29 # TODO(dpranke): Figure out how to get a list of failures out of
30 # gyp_flag_compare?
31 json.dump({
32 'valid': True,
33 'failures': ['compare_failed'] if rc else [],
34 }, args.output)
36 return rc
39 def main_compile_targets(args):
40 # TODO(dpranke): Figure out how to get args.args plumbed through to here.
41 json.dump([], args.output)
44 if __name__ == '__main__':
45 funcs = {
46 'run': main_run,
47 'compile_targets': main_compile_targets,
49 sys.exit(common.run_script(sys.argv[1:], funcs))