Add tests for some utils
This commit is contained in:
10
Makefile
10
Makefile
@ -5,7 +5,7 @@ LIBS=-lssl -lcrypto -lmagic -lz -lmaxminddb -lbrotlienc
|
||||
|
||||
DEBIAN_OPTS=-D CACHE_MAGIC_FILE="\"/usr/share/file/magic.mgc\"" -D PHP_FPM_SOCKET="\"/var/run/php/php7.4-fpm.sock\""
|
||||
|
||||
.PHONY: all prod debug default permit clean
|
||||
.PHONY: all prod debug default permit clean test
|
||||
all: prod
|
||||
default: bin bin/lib bin/libsesimos.so bin/sesimos
|
||||
prod: CFLAGS += -O3
|
||||
@ -14,6 +14,10 @@ debug: default
|
||||
debian: CFLAGS += $(DEBIAN_OPTS)
|
||||
debian: prod
|
||||
|
||||
test: CFLAGS += -include test/mock_*.h
|
||||
test: bin bin/test
|
||||
bin/test
|
||||
|
||||
|
||||
bin:
|
||||
mkdir -p bin
|
||||
@ -22,6 +26,10 @@ bin/lib:
|
||||
mkdir -p bin/lib
|
||||
|
||||
|
||||
bin/test: test/mock_*.c test/test_*.c src/lib/utils.c src/lib/sock.c
|
||||
$(CC) -o $@ $(CFLAGS) $^ -lcriterion
|
||||
|
||||
|
||||
bin/%.o: src/%.c
|
||||
$(CC) -c -o $@ $(CFLAGS) $<
|
||||
|
||||
|
Reference in New Issue
Block a user