fix: make test auto-sets HATE_CRACK_SKIP_INIT when binaries not built

Removes the need to manually prefix HATE_CRACK_SKIP_INIT=1 when running
make test or make coverage in a dev environment without compiled submodules.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Justin Bollinger
2026-02-20 16:22:29 -05:00
parent 15b3ab77fd
commit 67ed8c1ee3

View File

@@ -125,10 +125,18 @@ clean:
find . -name "__pycache__" -type d -prune -exec rm -rf {} + find . -name "__pycache__" -type d -prune -exec rm -rf {} +
test: test:
uv run pytest -v @# Auto-set HATE_CRACK_SKIP_INIT when hashcat-utils binaries are not built
@if [ -z "$$HATE_CRACK_SKIP_INIT" ] && [ ! -f hate_crack/hashcat-utils/bin/expander.bin ] && [ ! -f hate_crack/hashcat-utils/bin/expander.app ]; then \
echo "[test] hashcat-utils not built, setting HATE_CRACK_SKIP_INIT=1"; \
export HATE_CRACK_SKIP_INIT=1; \
fi; \
HATE_CRACK_SKIP_INIT=$${HATE_CRACK_SKIP_INIT:-1} uv run pytest -v
coverage: coverage:
uv run pytest --cov=hate_crack --cov-report=term-missing @if [ -z "$$HATE_CRACK_SKIP_INIT" ] && [ ! -f hate_crack/hashcat-utils/bin/expander.bin ] && [ ! -f hate_crack/hashcat-utils/bin/expander.app ]; then \
echo "[coverage] hashcat-utils not built, setting HATE_CRACK_SKIP_INIT=1"; \
fi; \
HATE_CRACK_SKIP_INIT=$${HATE_CRACK_SKIP_INIT:-1} uv run pytest --cov=hate_crack --cov-report=term-missing
ruff: ruff:
uv run ruff check hate_crack uv run ruff check hate_crack