3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-22 15:05:51 +00:00

Add local pre-commit hook running z3test regressions

Adds a versioned .githooks/pre-commit that builds z3 and runs the
z3test regression suite (scripts/test_benchmarks.py over
regressions/smt2) as a precondition for every commit. Enable with
'git config core.hooksPath .githooks'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Lev Nachmanson 2026-06-27 08:45:19 -07:00
parent 6a62a53181
commit d704b289ef
2 changed files with 85 additions and 0 deletions

27
.githooks/README.md Normal file
View file

@ -0,0 +1,27 @@
# Git hooks
Versioned git hooks for this repository.
## pre-commit
Builds the `z3` binary and runs the [z3test](https://github.com/Z3Prover/z3test)
regression suite (`scripts/test_benchmarks.py` over `regressions/smt2`) locally.
The commit is aborted if the build or any regression fails.
### Enable
```bash
git config core.hooksPath .githooks
```
### Configuration (environment variables)
- `Z3_BUILD_DIR` — build directory to use/create (default: `build/release`).
- `Z3TEST_DIR` — existing `z3test` checkout. If unset, `z3test` is cloned into
`../z3test-precommit` next to the repository.
### Skip for a single commit
```bash
git commit --no-verify
```