tupperware/Makefile
Bruno BELANYI 6f04d4b9df tests: add vector tests
We want to explicitly check overflows, so we need to enable that with
ASan.
2020-11-26 14:52:24 +01:00

39 lines
678 B
Makefile

CC = gcc
CFLAGS = -Wall -Wextra -pedantic -std=c99 -Werror
CPPFLAGS = -Iinclude/ -Itests/ -D_DEFAULT_SOURCE
VPATH = src/ tests/
SRC = \
src/avl.c \
src/list.c \
src/vector.c \
OBJS = $(SRC:.c=.o)
.PHONY: all
all: $(OBJS)
.PHONY: check
check: testsuite
ASAN_OPTIONS=allocator_may_return_null=1 ./testsuite --verbose
TEST_SRC = \
tests/avl.c \
tests/list.c \
tests/testsuite.c \
tests/vector.c \
TEST_OBJS = $(TEST_SRC:.c=.o)
testsuite: LDFLAGS+=-lcriterion -fsanitize=address
testsuite: CFLAGS+=-fsanitize=address
testsuite: CFLAGS+=-g
testsuite: $(OBJS) $(TEST_OBJS)
.PHONY: clean
clean:
$(RM) $(OBJS)
$(RM) $(TEST_OBJS)
$(RM) testsuite