blob: c7f14e686a58e774fe99d80ed31b61397f722f46 [file] [log] [blame]
Paweł Hajdan, Jrd96267702015-02-27 16:21:221#!/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
6import json
7import os
8import sys
9
10
11import common
12
13
14def main_run(args):
15 with common.temporary_file() as tempfile_path:
16 rc = common.run_command([
Paweł Hajdan, Jrc5f46a62015-03-04 16:12:4617 sys.executable,
Kent Tamura2e1fa052018-04-25 01:58:4318 os.path.join(common.SRC_DIR, 'third_party', 'blink',
19 'tools', 'run_blinkpy_tests.py'),
Paweł Hajdan, Jrd96267702015-02-27 16:21:2220 '--write-full-results-to', tempfile_path,
Paweł Hajdan, Jr900ece22016-07-12 13:19:1221 ], cwd=args.paths['checkout'])
Paweł Hajdan, Jrd96267702015-02-27 16:21:2222
23 with open(tempfile_path) as f:
24 results = json.load(f)
25
26 parsed_results = common.parse_common_test_results(results)
27 failures = parsed_results['unexpected_failures']
28
29 json.dump({
30 'valid': bool(rc <= common.MAX_FAILURES_EXIT_STATUS and
31 ((rc == 0) or failures)),
32 'failures': failures.keys(),
33 }, args.output)
34
35 return rc
36
37
38def main_compile_targets(args):
39 json.dump([], args.output)
40
41
42if __name__ == '__main__':
43 funcs = {
44 'run': main_run,
45 'compile_targets': main_compile_targets,
46 }
47 sys.exit(common.run_script(sys.argv[1:], funcs))