OLD | NEW |
---|---|
(Empty) | |
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. | |
5 | |
6 """Wrap `gn check` for the bots. | |
7 | |
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). | |
11 | |
12 The script takes no arguments. | |
13 """ | |
14 | |
15 | |
16 import json | |
17 import os | |
18 import sys | |
19 | |
20 | |
21 import common | |
22 | |
23 | |
24 def main_run(args): | |
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') | |
29 else: | |
30 exe = os.path.join(common.SRC_DIR, 'buildtools', 'linux64', 'gn') | |
31 | |
32 rc = common.run_command([ | |
33 exe, | |
34 '--root=%s' % common.SRC_DIR, | |
35 'check', | |
36 '//out/%s' % args.build_config_fs, | |
37 ]) | |
38 | |
39 json.dump({ | |
40 'valid': True, | |
41 'failures': [], | |
Paweł Hajdan Jr.
2015/05/15 10:14:07
Do you intend this to always pass? If there are an
Dirk Pranke
2015/05/15 15:09:40
I expect the step to fail if rc is nonzero. I don'
Paweł Hajdan Jr.
2015/05/15 15:41:14
It's expected by recipes that if rc is nonzero the
| |
42 }, args.output) | |
43 | |
44 return rc | |
45 | |
46 | |
47 def main_compile_targets(args): | |
48 json.dump([], args.output) | |
49 | |
50 | |
51 if __name__ == '__main__': | |
52 funcs = { | |
53 'run': main_run, | |
54 'compile_targets': main_compile_targets, | |
55 } | |
56 sys.exit(common.run_script(sys.argv[1:], funcs)) | |
OLD | NEW |