| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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()) |
| OLD | NEW |