diff options
Diffstat (limited to 'test/GNUmakefile')
| -rw-r--r-- | test/GNUmakefile | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/test/GNUmakefile b/test/GNUmakefile index 10e3b34..5e57930 100644 --- a/test/GNUmakefile +++ b/test/GNUmakefile @@ -1,6 +1,7 @@ -TESTS = $(basename $(shell find . -type f -name '*.cpp')) -CXX = g++ -std=gnu++20 -I ../content/ -O2 -Wall -Wextra -Wshadow -Werror +TESTS = $(basename $(shell find . -path ./awk -prune -o -type f -name '*.cpp' -print)) +AWK = $(basename $(shell find . -type f -name '*.awk')) +CXX = g++ -std=gnu++20 -I awk/ -I ../content/ -O2 -Wall -Wextra -Wshadow -Werror test: $(TESTS:=.ok) @@ -8,11 +9,12 @@ missing: @find ../content -name '*.cpp' | sed 's|^../content/||' \ | while read -r f ; do [ -e "$$f" ] || echo "$$f" ; done \ | sort > missing.tmp - @sort missing.ignore | comm -23 missing.tmp - + @sort missing.ignore | comm -3 missing.tmp - @rm missing.tmp clean: rm -f $(TESTS:=.test) $(TESTS:=.ok) $(TESTS:=.d) + rm -rf awk/ %.ok: %.test timeout --foreground --verbose 60 prlimit -s$$((1<<32)) ./$< @@ -21,10 +23,14 @@ clean: %.test: %.cpp $(CXX) -o $@ $< -%.d: %.cpp +awk/%: %.awk ../content/% + @mkdir -p $(dir $@) + awk -f $*.awk < ../content/$* > $@ + +%.d: %.cpp $(addprefix awk/,$(AWK)) $(CXX) -M -MT '$*.test $*.d' -MF $@ $< .PHONY: test clean -.SECONDARY: $(TESTS:=.test) +.SECONDARY: $(TESTS:=.test) $(addprefix awk/,$(AWK)) include $(TESTS:=.d) |
