From 10eb77f9323110c55f88195c5b8207eb524baa73 Mon Sep 17 00:00:00 2001 From: Vincent Douillet Date: Mon, 13 May 2024 20:44:07 +0200 Subject: add unit tests --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 11e3aef..f24297e 100644 --- a/Makefile +++ b/Makefile @@ -33,8 +33,9 @@ LDFLAGS_DEPS != pkg-config --libs kcgi kcgi-html CFLAGS=-DLOG_INFO $(CFLAGS_DEPS) LDFLAGS=-static $(LDFLAGS_DEPS) -.if make(debug) -CFLAGS+=-O0 -g -W -Wall -Wextra -DTEMPLATE_DIR='"template"' +.if make(debug) || make(test) +PWD!=pwd +CFLAGS+=-O0 -g -W -Wall -Wextra -DDATA_DIR='"$(PWD)/test-data"' -DTEMPLATE_DIR='"template"' .else CFLAGS+=-O2 .endif @@ -49,6 +50,9 @@ all: main main: mime.o url.o template.o file.o http.o download.o browse.o main.o $(CC) -o $@ $> $(LDFLAGS) +test: mime.o url.o template.o file.o http.o download.o browse.o test.o + $(CC) -o $@ $> $(LDFLAGS) + env: env.o $(CC) -o $@ $> $(LDFLAGS) @@ -72,7 +76,7 @@ install: gzip -fk /var/www/vault-static/fontawesome-6.5.1/webfonts/fa-solid-900.woff2 clean: - rm -f *.o *.BAK main + rm -f *.o *.BAK main test links: links http://localhost/cgi-bin/vault -- cgit v1.2.3