Coverage for fuzz/run_fuzz.py: 100%
14 statements
« prev ^ index » next coverage.py v7.17.3, created at 2026-11-22 12:55 +0000
« prev ^ index » next coverage.py v7.17.3, created at 2026-11-22 12:55 +0000
1"""Atheris entry point (V6.6.7, #363): `python fuzz/run_fuzz.py <target> [libFuzzer flags] [corpus dir]`.
3Runs in `.github/workflows/fuzz.yml` (Atheris has Linux wheels only). The targets live in `fuzz/targets.py`, which
4the tests drive with hypothesis on any machine.
5"""
7from __future__ import annotations
9import sys
10from pathlib import Path
12import atheris
14sys.path.insert(0, str(Path(__file__).resolve().parent))
16with atheris.instrument_imports():
17 from targets import TARGETS
20def main(argv: list[str]) -> None:
21 if len(argv) < 2 or argv[1] not in TARGETS:
22 raise SystemExit(f"usage: run_fuzz.py <{'|'.join(sorted(TARGETS))}> [libFuzzer flags] [corpus]")
23 atheris.Setup([argv[0], *argv[2:]], TARGETS[argv[1]])
24 atheris.Fuzz()
27if __name__ == "__main__":
28 main(sys.argv)