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

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

Issue 1314313004: [Android][telemetry] Update pylib imports for modules that moved into devil. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/utils/timeout_retry_unittest.py ('k') | build/android/enable_asserts.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 from pylib.utils import run_tests_helper 27 from devil.utils import run_tests_helper
28 28
29 NOT_EXECUTABLE = -1 29 NOT_EXECUTABLE = -1
30 NOT_COVERED = 0 30 NOT_COVERED = 0
31 COVERED = 1 31 COVERED = 1
32 PARTIALLY_COVERED = 2 32 PARTIALLY_COVERED = 2
33 33
34 # Coverage information about a single line of code. 34 # Coverage information about a single line of code.
35 LineCoverage = collections.namedtuple( 35 LineCoverage = collections.namedtuple(
36 'LineCoverage', 36 'LineCoverage',
37 ['lineno', 'source', 'covered_status', 'fractional_line_coverage']) 37 ['lineno', 'source', 'covered_status', 'fractional_line_coverage'])
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 'code for which coverage information is desired.') 466 'code for which coverage information is desired.')
467 argparser.add_argument('-v', '--verbose', action='count', 467 argparser.add_argument('-v', '--verbose', action='count',
468 help='Print verbose log information.') 468 help='Print verbose log information.')
469 args = argparser.parse_args() 469 args = argparser.parse_args()
470 run_tests_helper.SetLogLevel(args.verbose) 470 run_tests_helper.SetLogLevel(args.verbose)
471 GenerateCoverageReport(args.lines_for_coverage_file, args.out, args.emma_dir) 471 GenerateCoverageReport(args.lines_for_coverage_file, args.out, args.emma_dir)
472 472
473 473
474 if __name__ == '__main__': 474 if __name__ == '__main__':
475 sys.exit(main()) 475 sys.exit(main())
OLDNEW
« no previous file with comments | « build/android/devil/utils/timeout_retry_unittest.py ('k') | build/android/enable_asserts.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698