()
| 591 | callers=self._callers) |
| 592 | |
| 593 | def main(): |
| 594 | import argparse |
| 595 | |
| 596 | parser = argparse.ArgumentParser() |
| 597 | parser.add_argument('--version', action='version', version='trace 2.0') |
| 598 | |
| 599 | grp = parser.add_argument_group('Main options', |
| 600 | 'One of these (or --report) must be given') |
| 601 | |
| 602 | grp.add_argument('-c', '--count', action='store_true', |
| 603 | help='Count the number of times each line is executed and write ' |
| 604 | 'the counts to <module>.cover for each module executed, in ' |
| 605 | 'the module\'s directory. See also --coverdir, --file, ' |
| 606 | '--no-report below.') |
| 607 | grp.add_argument('-t', '--trace', action='store_true', |
| 608 | help='Print each line to sys.stdout before it is executed') |
| 609 | grp.add_argument('-l', '--listfuncs', action='store_true', |
| 610 | help='Keep track of which functions are executed at least once ' |
| 611 | 'and write the results to sys.stdout after the program exits. ' |
| 612 | 'Cannot be specified alongside --trace or --count.') |
| 613 | grp.add_argument('-T', '--trackcalls', action='store_true', |
| 614 | help='Keep track of caller/called pairs and write the results to ' |
| 615 | 'sys.stdout after the program exits.') |
| 616 | |
| 617 | grp = parser.add_argument_group('Modifiers') |
| 618 | |
| 619 | _grp = grp.add_mutually_exclusive_group() |
| 620 | _grp.add_argument('-r', '--report', action='store_true', |
| 621 | help='Generate a report from a counts file; does not execute any ' |
| 622 | 'code. --file must specify the results file to read, which ' |
| 623 | 'must have been created in a previous run with --count ' |
| 624 | '--file=FILE') |
| 625 | _grp.add_argument('-R', '--no-report', action='store_true', |
| 626 | help='Do not generate the coverage report files. ' |
| 627 | 'Useful if you want to accumulate over several runs.') |
| 628 | |
| 629 | grp.add_argument('-f', '--file', |
| 630 | help='File to accumulate counts over several runs') |
| 631 | grp.add_argument('-C', '--coverdir', |
| 632 | help='Directory where the report files go. The coverage report ' |
| 633 | 'for <package>.<module> will be written to file ' |
| 634 | '<dir>/<package>/<module>.cover') |
| 635 | grp.add_argument('-m', '--missing', action='store_true', |
| 636 | help='Annotate executable lines that were not executed with ' |
| 637 | '">>>>>> "') |
| 638 | grp.add_argument('-s', '--summary', action='store_true', |
| 639 | help='Write a brief summary for each file to sys.stdout. ' |
| 640 | 'Can only be used with --count or --report') |
| 641 | grp.add_argument('-g', '--timing', action='store_true', |
| 642 | help='Prefix each line with the time since the program started. ' |
| 643 | 'Only used while tracing') |
| 644 | |
| 645 | grp = parser.add_argument_group('Filters', |
| 646 | 'Can be specified multiple times') |
| 647 | grp.add_argument('--ignore-module', action='append', default=[], |
| 648 | help='Ignore the given module(s) and its submodules ' |
| 649 | '(if it is a package). Accepts comma separated list of ' |
| 650 | 'module names.') |
no test coverage detected