aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 12 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index f550c31..f196633 100644
--- a/Makefile
+++ b/Makefile
@@ -37,7 +37,7 @@ bin/%.o: %.scm | bin
csc -c -J -unit downstroke-$* $*.scm -o bin/$*.o -I bin
@if [ -f downstroke-$*.import.scm ]; then mv downstroke-$*.import.scm bin/; fi
-.PHONY: clean test engine demos
+.PHONY: clean test engine demos filter
clean:
rm -rf bin downstroke/
@@ -59,6 +59,17 @@ test:
@csi -s tests/scene-loader-test.scm
@csi -s tests/tween-test.scm
+# Run a single test file with optional name/group filtering (pytest -k style).
+# make filter FILE=tests/physics-test.scm # whole file
+# make filter FILE=tests/physics-test.scm K=gravity # tests matching regex
+# make filter FILE=tests/physics-test.scm G=apply # groups matching regex
+# Note: combining K/G with TEST_QUIET=1 hits a known bug in the `test` egg
+# (modulo error in summary timing), so this target intentionally doesn't
+# expose Q. Use `TEST_QUIET=1 csi -s <file>` directly when you want quiet.
+filter:
+ @if [ -z "$(FILE)" ]; then echo "usage: make filter FILE=<test.scm> [K=name-regex] [G=group-regex]"; exit 2; fi
+ @$(if $(K),TEST_FILTER='$(K)') $(if $(G),TEST_GROUP_FILTER='$(G)') csi -s $(FILE)
+
demos: engine $(DEMO_BINS)
bin/demo-%: demo/%.scm $(OBJECT_FILES) | bin