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

Side by Side Diff: tools/cov.py

Issue 2322963004: Clean up formatting, rework run wrapper script to not use globals. (Closed)
Patch Set: update w/ review feedback, lint Created 4 years, 2 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 | « setup.py ('k') | typ/fakes/test_result_server_fake.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 2014 Google Inc. All rights reserved. 2 # Copyright 2014 Google Inc. All rights reserved.
3 # 3 #
4 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License. 5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at 6 # You may obtain a copy of the License at
7 # 7 #
8 # http://www.apache.org/licenses/LICENSE-2.0 8 # http://www.apache.org/licenses/LICENSE-2.0
9 # 9 #
10 # Unless required by applicable law or agreed to in writing, software 10 # Unless required by applicable law or agreed to in writing, software
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 parser.add_argument('--source', action='append', default=[], 54 parser.add_argument('--source', action='append', default=[],
55 help='Limit coverage data to the given directories.') 55 help='Limit coverage data to the given directories.')
56 56
57 parser.formatter_class = argparse.RawTextHelpFormatter 57 parser.formatter_class = argparse.RawTextHelpFormatter
58 parser.epilog = textwrap.dedent(""" 58 parser.epilog = textwrap.dedent("""
59 Valid pragma values are: 59 Valid pragma values are:
60 'no cover': The default coverage pragma, this now means we 60 'no cover': The default coverage pragma, this now means we
61 truly cannot cover it. 61 truly cannot cover it.
62 'no win32': Code that only executes when not on Windows. 62 'no win32': Code that only executes when not on Windows.
63 'python2': Code that only executes under Python2. 63 'python2': Code that only executes under Python2.
64 'python3': Code that only executees under Python3. 64 'python3': Code that only executes under Python3.
65 'untested': Code that does not yet have tests. 65 'untested': Code that does not yet have tests.
66 'win32': Code that only executes on Windows. 66 'win32': Code that only executes on Windows.
67 67
68 In typ, we aim for 'no cover' to only apply to code that executes only 68 In typ, we aim for 'no cover' to only apply to code that executes only
69 when coverage is not available (and hence can never be counted). Most 69 when coverage is not available (and hence can never be counted). Most
70 code, if annotated at all, should be 'untested', and we should strive 70 code, if annotated at all, should be 'untested', and we should strive
71 for 'untested' to not be used, either. 71 for 'untested' to not be used, either.
72 """) 72 """)
73 73
74 74
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 except SystemExit as e: 133 except SystemExit as e:
134 ret = e.code 134 ret = e.code
135 cov.stop() 135 cov.stop()
136 cov.save() 136 cov.save()
137 cov.report(show_missing=args.show_missing) 137 cov.report(show_missing=args.show_missing)
138 return ret 138 return ret
139 139
140 140
141 if __name__ == '__main__': 141 if __name__ == '__main__':
142 sys.exit(main()) 142 sys.exit(main())
OLDNEW
« no previous file with comments | « setup.py ('k') | typ/fakes/test_result_server_fake.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698