Update V8 to version 4.6.54.
[chromium-blink-merge.git] / testing / scripts / telemetry_gpu_unittests.py
blobcf9862e3e2405481f0bace2ed98ebf262dcfb334
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 import json
7 import os
8 import sys
11 import common
14 def main_run(args):
15 filter_tests = []
16 if args.filter_file:
17 filter_tests = json.load(args.filter_file)
19 with common.temporary_file() as tempfile_path:
20 rc = common.run_runtest(args, [
21 '--test-type', 'telemetry_gpu_unittests',
22 '--run-python-script',
23 os.path.join(common.SRC_DIR,
24 'content', 'test', 'gpu', 'run_unittests.py'),
25 '--retry-limit', '3',
26 '--write-full-results-to', tempfile_path,
27 ] + filter_tests)
29 with open(tempfile_path) as f:
30 results = json.load(f)
32 parsed_results = common.parse_common_test_results(results, test_separator='.')
33 failures = parsed_results['unexpected_failures']
35 json.dump({
36 'valid': bool(rc <= common.MAX_FAILURES_EXIT_STATUS and
37 ((rc == 0) or failures)),
38 'failures': failures.keys(),
39 }, args.output)
41 return rc
44 def main_compile_targets(args):
45 json.dump([], args.output)
48 if __name__ == '__main__':
49 funcs = {
50 'run': main_run,
51 'compile_targets': main_compile_targets,
53 sys.exit(common.run_script(sys.argv[1:], funcs))