evalexpr: tests: add Criterion testsuite
This commit is contained in:
parent
b5b2744a1e
commit
f9719e9c9b
4 changed files with 390 additions and 1 deletions
16
Makefile
16
Makefile
|
|
@ -1,7 +1,7 @@
|
|||
CC = gcc
|
||||
CPPFLAGS = -Isrc/ -D_POSIX_C_SOURCE=200809L -D_USE_CLIMBING=$(USE_CLIMBING)
|
||||
CFLAGS = -Wall -Wextra -pedantic -Werror -std=c99
|
||||
VPATH = src/
|
||||
VPATH = src/ tests/
|
||||
USE_CLIMBING = 1
|
||||
|
||||
SRC = \
|
||||
|
|
@ -19,6 +19,20 @@ all: $(BIN)
|
|||
# Write this one rule instead of using the implicit rules to buid at the root
|
||||
$(BIN): $(OBJ) src/evalexpr.o
|
||||
|
||||
check: testsuite
|
||||
./testsuite --verbose
|
||||
|
||||
TEST_SRC = \
|
||||
tests/climbing.c \
|
||||
tests/recursive.c \
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue