From a633bdeccadd4d2d708288807d41af7bf5385376 Mon Sep 17 00:00:00 2001 From: Justin Bollinger Date: Fri, 20 Feb 2026 16:22:29 -0500 Subject: [PATCH] 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 --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a90defa..099b72c 100644 --- a/Makefile +++ b/Makefile @@ -125,10 +125,18 @@ clean: find . -name "__pycache__" -type d -prune -exec rm -rf {} + 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: - 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: uv run ruff check hate_crack