From a02b892e2ad1e1605ff942c63afdd618daa48be4 Mon Sep 17 00:00:00 2001 From: Gene Pasquet Date: Fri, 17 Apr 2026 16:52:41 +0100 Subject: Migrate tests to the test egg --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Makefile') 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 ` directly when you want quiet. +filter: + @if [ -z "$(FILE)" ]; then echo "usage: make filter FILE= [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 -- cgit v1.2.3