tests: add testsuite
This commit is contained in:
parent
26d30b43f4
commit
f1537c5178
2 changed files with 90 additions and 1 deletions
15
Makefile
15
Makefile
|
|
@ -1,7 +1,7 @@
|
|||
CC = gcc
|
||||
CPPFLAGS = -Isrc/ -D_POSIX_C_SOURCE=200809L
|
||||
VPATH = src/
|
||||
CFLAGS = -Wall -Wextra -pedantic -Werror -std=c99
|
||||
VPATH = src/ tests/
|
||||
USE_CLIMBING = 1
|
||||
|
||||
SRC = \
|
||||
|
|
@ -16,7 +16,20 @@ all: $(BIN)
|
|||
$(BIN):
|
||||
$(BIN): $(OBJ) src/pratt.o
|
||||
|
||||
check: testsuite
|
||||
./testsuite --verbose
|
||||
|
||||
TEST_SRC = \
|
||||
tests/testsuite.c \
|
||||
|
||||
TEST_OBJ = $(TEST_SRC:.c=.o)
|
||||
|
||||
testsuite: LDFLAGS+=-lcriterion -fsanitize=address
|
||||
testsuite: CFLAGS+=-fsanitize=address
|
||||
testsuite: $(OBJ) $(TEST_OBJ)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(RM) $(OBJ) # remove object files
|
||||
$(RM) $(BIN) # remove main program
|
||||
$(RM) testsuite
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue