(argv)
| 586 | |
| 587 | |
| 588 | def main(argv): |
| 589 | # Get a clean parent path relative to PWD |
| 590 | default_root_dir = relative_parents(Path(__file__), level=2) |
| 591 | if len(argv) >= 1: |
| 592 | default_gcmole_dir = relative_parents(Path(argv[0])) |
| 593 | if default_gcmole_dir or not default_gcmole_dir.exists(): |
| 594 | default_gcmole_dir = default_root_dir / 'tools' / 'gcmole' |
| 595 | default_clang_bin_dir = default_gcmole_dir / 'gcmole-tools/bin' |
| 596 | |
| 597 | def add_common_args(parser): |
| 598 | archs = list(ARCHITECTURES.keys()) |
| 599 | parser.add_argument( |
| 600 | "--v8-root-dir", |
| 601 | metavar="DIR", |
| 602 | default=default_root_dir, |
| 603 | help="V8 checkout directory. Default: '{}'".format( |
| 604 | default_root_dir.absolute())) |
| 605 | parser.add_argument( |
| 606 | "--v8-target-cpu", |
| 607 | default="x64", |
| 608 | choices=archs, |
| 609 | help="Tested CPU architecture. Choices: {}".format(archs), |
| 610 | metavar="CPU") |
| 611 | parser.add_argument( |
| 612 | "--clang-bin-dir", |
| 613 | metavar="DIR", |
| 614 | help="Build dir of the custom clang version for gcmole." + \ |
| 615 | "Default: env['CLANG_DIR'] or '{}'".format(default_clang_bin_dir)) |
| 616 | parser.add_argument( |
| 617 | "--clang-plugins-dir", |
| 618 | metavar="DIR", |
| 619 | help="Containing dir for libgcmole.so." |
| 620 | "Default: env['CLANG_PLUGINS'] or '{}'".format(default_gcmole_dir)) |
| 621 | parser.add_argument( |
| 622 | "--v8-build-dir", |
| 623 | metavar="BUILD_DIR", |
| 624 | help="GN build dir for v8. Default: 'out/CPU.Release'. " |
| 625 | "Config must match cpu specified by --v8-target-cpu") |
| 626 | parser.add_argument( |
| 627 | "--out-dir", |
| 628 | metavar="DIR", |
| 629 | help="Output location for the gcsuspect and gcauses file." |
| 630 | "Default: BUILD_DIR/gen/tools/gcmole") |
| 631 | parser.add_argument( |
| 632 | "--is-bot", |
| 633 | action="store_true", |
| 634 | default=False, |
| 635 | help="Flag for setting build bot specific settings.") |
| 636 | parser.add_argument( |
| 637 | "--shard-count", |
| 638 | default=1, |
| 639 | type=int, |
| 640 | help="Number of tasks the current action (e.g. collect or check) " |
| 641 | "is distributed to.") |
| 642 | parser.add_argument( |
| 643 | "--shard-index", |
| 644 | default=0, |
| 645 | type=int, |
no test coverage detected