test/sam: add tests for empty matches at the end of a range
[vis-test.git] / core / Makefile
blob2d4b8ee6454ee1bef40d7998bcff037260b7a1b9
1 -include ../../config.mk
3 ALL = buffer-test map-test array-test text-test
4 SRC = $(wildcard ccan/*/*.c)
5 CFLAGS += -I. -I../.. -DBUFFER_SIZE=4 -DBLOCK_SIZE=4
7 test: $(ALL)
8 @./buffer-test
9 @./map-test
10 @./array-test
11 @./text-test
13 config.h:
14 @echo Generating ccan configuration header
15 @${CC} ccan-config.c -o ccan-config && ./ccan-config > config.h
17 text-test: config.h text-test.c ../../text.c ../../text-common.c ../../text-io.c ../../text-iterator.c ../../text-util.c ../../text-motions.c ../../text-objects.c ../../text-regex.c ../../array.c
18 @echo Compiling $@ binary
19 @${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_LIBC} ${CFLAGS_EXTRA} ${filter %.c, $^} ${SRC} ${LDFLAGS} -o $@
21 buffer-test: config.h buffer-test.c ../../buffer.c
22 @echo Compiling $@ binary
23 @${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_LIBC} ${CFLAGS_EXTRA} ${filter %.c, $^} ${SRC} ${LDFLAGS} -o $@
25 map-test: config.h map-test.c ../../map.c
26 @echo Compiling $@ binary
27 @${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_LIBC} ${CFLAGS_EXTRA} ${filter %.c, $^} ${SRC} ${LDFLAGS} -o $@
29 array-test: config.h array-test.c ../../array.c
30 @echo Compiling $@ binary
31 @${CC} ${CFLAGS} ${CFLAGS_STD} ${CFLAGS_LIBC} ${CFLAGS_EXTRA} ${filter %.c, $^} ${SRC} ${LDFLAGS} -o $@
33 debug: clean
34 $(MAKE) CFLAGS_EXTRA='${CFLAGS_EXTRA} ${CFLAGS_DEBUG}'
36 coverage: clean
37 $(MAKE) CFLAGS_EXTRA='--coverage'
39 asan: clean
40 $(MAKE) CFLAGS_EXTRA='-fsanitize=address'
42 ubsan: clean
43 $(MAKE) CFLAGS_EXTRA='-fsanitize=undefined'
45 msan: clean
46 $(MAKE) CFLAGS_EXTRA='-fsanitize=memory -fsanitize-memory-track-origins'
48 valgrind: clean ${ALL}
49 @for test in ${ALL}; do \
50 valgrind --leak-check=full --log-file="$$test.valgrind" "./$$test"; \
51 cat "$$test.valgrind"; \
52 grep LEAK "$$test.valgrind" >/dev/null && exit 1 || true; \
53 done
55 tis: clean
56 $(MAKE) CC="tis-interpreter.sh --cc" CFLAGS='"${CFLAGS} ${CFLAGS_STD} -DHAVE_MEMRCHR=0 -DTIS_INTERPRETER=1"' CFLAGS_STD='' CFLAGS_LIBC='' LDFLAGS='#' $(ALL)
58 clean:
59 @echo cleaning
60 @rm -f ccan-config config.h
61 @rm -f data symlink hardlink
62 @rm -f $(ALL)
63 @rm -f *.gcov *.gcda *.gcno
64 @rm -f *.valgrind
66 .PHONY: clean debug coverage tis valgrind asan ubsan msan