diff options
Diffstat (limited to 'test/GNUmakefile')
| -rw-r--r-- | test/GNUmakefile | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/GNUmakefile b/test/GNUmakefile index e7470a3..cc1b4f5 100644 --- a/test/GNUmakefile +++ b/test/GNUmakefile @@ -2,8 +2,10 @@ 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 +SAN = -fsanitize=address,undefined -DSANITIZE +TIMEOUT = 300 -test: $(TESTS:=.ok) +test: $(TESTS:=.ok) $(TESTS:=.san.ok) missing: @find ../content -name '*.cpp' | sed 's|^../content/||' \ @@ -13,22 +15,25 @@ missing: @rm missing.tmp clean: - rm -f $(TESTS:=.test) $(TESTS:=.ok) $(TESTS:=.d) + rm -f $(TESTS:=.test) $(TESTS:=.ok) $(TESTS:=.san.ok) $(TESTS:=.d) rm -rf awk/ %.ok: %.test - timeout --foreground --verbose 60 prlimit -s$$((1<<32)) ./$< + timeout --foreground --verbose $(TIMEOUT) prlimit -s$$((1<<32)) ./$< @touch $@ %.test: %.cpp $(CXX) -o $@ $< +%.san.test: %.cpp + $(CXX) $(SAN) -o $@ $< + awk/%: %.awk ../content/% @mkdir -p $(dir $@) awk -f $*.awk < ../content/$* > $@ %.d: %.cpp $(addprefix awk/,$(AWK)) - $(CXX) -M -MP -MT '$*.test $*.d' -MF $@ $< + $(CXX) -M -MP -MT '$*.test $*.san.test $*.d' -MF $@ $< .PHONY: test clean .SECONDARY: $(TESTS:=.test) $(addprefix awk/,$(AWK)) |
