aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 14 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 31c258e..9945126 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ DE := $(filter dwm hyprland,$(MAKECMDGOALS))
# Extract DEST from command line for import (e.g., 'make import common' -> DEST=common)
DEST := $(filter common dwm hyprland,$(MAKECMDGOALS))
-.PHONY: help deps stow restow reset unstow import test test-keep test-vm-base common dwm hyprland
+.PHONY: help deps stow restow reset unstow import test-unit test test-keep test-vm-base common dwm hyprland
# Default target - show help
help:
@@ -30,6 +30,7 @@ help:
@echo " reset Resolve conflicts, keep repo version - requires DE"
@echo " unstow Remove all symlinks - requires DE"
@echo " import Import new app configs into repo (fzf) - requires dest"
+ @echo " test-unit Run fast unit tests for scripts (no VM needed)"
@echo " test Run full VM test suite (creates base VM if needed)"
@echo " test-keep Run test and keep VM running for manual testing"
@echo " test-vm-base Create base VM only (runs archangel)"
@@ -161,6 +162,18 @@ import: check-dest
echo ""; \
echo "Done. Don't forget to: git add -A && git commit"
+# Run the fast unit-test suites for individual scripts (no VM needed).
+# One suite per tests/<script>/ dir; `unittest discover` can't find them
+# because the dir names are hyphenated, so each suite is run explicitly.
+test-unit:
+ @fail=0; \
+ for t in tests/*/test_*.py; do \
+ mod=$$(echo "$$t" | sed 's|/|.|g; s|\.py$$||'); \
+ echo "==> $$mod"; \
+ python3 -m unittest "$$mod" || fail=1; \
+ done; \
+ exit $$fail
+
# Create base VM for testing (runs archangel only, no archsetup)
test-vm-base:
@bash scripts/testing/create-base-vm.sh