()
| 875 | |
| 876 | |
| 877 | def main() -> int: |
| 878 | args = parse_args() |
| 879 | if args.print_auto_skip: |
| 880 | for entry in sorted(load_auto_skip()): |
| 881 | print(entry) |
| 882 | return 0 |
| 883 | |
| 884 | if args.collect: |
| 885 | paths = parse_rerun_from_log(Path(args.collect)) |
| 886 | if args.output: |
| 887 | out = Path(args.output) |
| 888 | ensure_dirs(out, is_file=True) |
| 889 | out.write_text("\n".join(paths) + "\n", encoding="utf-8") |
| 890 | print(f"Wrote {len(paths)} entries to {out}") |
| 891 | else: |
| 892 | for p in paths: |
| 893 | print(p) |
| 894 | return 0 |
| 895 | |
| 896 | examples = discover_examples(args.filter) |
| 897 | if args.rerun_file: |
| 898 | rerun_set = { |
| 899 | line.strip() |
| 900 | for line in Path(args.rerun_file).read_text(encoding="utf-8").splitlines() |
| 901 | if line.strip() |
| 902 | } |
| 903 | examples = [ex for ex in examples if ex.relpath in rerun_set] |
| 904 | if not examples: |
| 905 | print("Rerun list is empty; nothing to do.") |
| 906 | return 0 |
| 907 | print(f"Rerun mode: {len(examples)} example(s) from {args.rerun_file}") |
| 908 | |
| 909 | return run_examples(examples, args) |
| 910 | |
| 911 | |
| 912 | if __name__ == "__main__": |
no test coverage detected