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 `gn check` for the bots.
8 This script wraps the `gn check` command 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 no arguments.
25 if sys
.platform
== 'win32':
26 exe
= os
.path
.join(common
.SRC_DIR
, 'buildtools', 'win', 'gn.exe')
27 elif sys
.platform
== 'mac':
28 exe
= os
.path
.join(common
.SRC_DIR
, 'buildtools', 'mac', 'gn')
30 exe
= os
.path
.join(common
.SRC_DIR
, 'buildtools', 'linux64', 'gn')
32 rc
= common
.run_command([
34 '--root=%s' % common
.SRC_DIR
,
36 '//out/%s' % args
.build_config_fs
,
39 # TODO(dpranke): Figure out how to get a list of failures out of gn check?
42 'failures': ['check_failed'] if rc
else [],
48 def main_compile_targets(args
):
49 json
.dump([], args
.output
)
52 if __name__
== '__main__':
55 'compile_targets': main_compile_targets
,
57 sys
.exit(common
.run_script(sys
.argv
[1:], funcs
))