mirror of
https://github.com/trustedsec/hate_crack.git
synced 2026-03-12 21:23:05 -07:00
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:
12
Makefile
12
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
|
||||
|
||||
Reference in New Issue
Block a user