Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: build/android/emma_coverage_stats.py

Issue 1571803002: [Android] Prepare build/android/ for catapult+devil. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@create-device-library-links
Patch Set: rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/android/devil_chromium.py ('k') | build/android/emma_coverage_stats_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 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 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Generates incremental code coverage reports for Java code in Chromium. 6 """Generates incremental code coverage reports for Java code in Chromium.
7 7
8 Usage: 8 Usage:
9 9
10 build/android/emma_coverage_stats.py -v --out <output file path> --emma-dir 10 build/android/emma_coverage_stats.py -v --out <output file path> --emma-dir
11 <EMMA file directory> --lines-for-coverage-file 11 <EMMA file directory> --lines-for-coverage-file
12 <path to file containing lines for coverage> 12 <path to file containing lines for coverage>
13 13
14 Creates a JSON representation of the overall and file coverage stats and saves 14 Creates a JSON representation of the overall and file coverage stats and saves
15 this information to the specified output file. 15 this information to the specified output file.
16 """ 16 """
17 17
18 import argparse 18 import argparse
19 import collections 19 import collections
20 import json 20 import json
21 import logging 21 import logging
22 import os 22 import os
23 import re 23 import re
24 import sys 24 import sys
25 from xml.etree import ElementTree 25 from xml.etree import ElementTree
26 26
27 import devil_chromium
27 from devil.utils import run_tests_helper 28 from devil.utils import run_tests_helper
28 29
29 NOT_EXECUTABLE = -1 30 NOT_EXECUTABLE = -1
30 NOT_COVERED = 0 31 NOT_COVERED = 0
31 COVERED = 1 32 COVERED = 1
32 PARTIALLY_COVERED = 2 33 PARTIALLY_COVERED = 2
33 34
34 # Coverage information about a single line of code. 35 # Coverage information about a single line of code.
35 LineCoverage = collections.namedtuple( 36 LineCoverage = collections.namedtuple(
36 'LineCoverage', 37 'LineCoverage',
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 argparser.add_argument('--emma-dir', required=True, type=str, 464 argparser.add_argument('--emma-dir', required=True, type=str,
464 help='EMMA HTML report directory.') 465 help='EMMA HTML report directory.')
465 argparser.add_argument('--lines-for-coverage-file', required=True, type=str, 466 argparser.add_argument('--lines-for-coverage-file', required=True, type=str,
466 help='File containing a JSON object. Should contain a ' 467 help='File containing a JSON object. Should contain a '
467 'dict mapping file names to lists of line numbers of ' 468 'dict mapping file names to lists of line numbers of '
468 'code for which coverage information is desired.') 469 'code for which coverage information is desired.')
469 argparser.add_argument('-v', '--verbose', action='count', 470 argparser.add_argument('-v', '--verbose', action='count',
470 help='Print verbose log information.') 471 help='Print verbose log information.')
471 args = argparser.parse_args() 472 args = argparser.parse_args()
472 run_tests_helper.SetLogLevel(args.verbose) 473 run_tests_helper.SetLogLevel(args.verbose)
474 devil_chromium.Initialize()
473 GenerateCoverageReport(args.lines_for_coverage_file, args.out, args.emma_dir) 475 GenerateCoverageReport(args.lines_for_coverage_file, args.out, args.emma_dir)
474 476
475 477
476 if __name__ == '__main__': 478 if __name__ == '__main__':
477 sys.exit(main()) 479 sys.exit(main())
OLDNEW
« no previous file with comments | « build/android/devil_chromium.py ('k') | build/android/emma_coverage_stats_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698