Add tests for config

I have started writing tests for the config functions. This has resulted
in a few changes to the config code (tests working I guess)

I have also added a special "all" config file which (as the name
suggests) runs all test suites

In the makefile I have added the compiled test files to the clean target
and added targets for building and running tests
This commit is contained in:
Jonathan Hodgson 2021-12-28 00:28:56 +00:00
parent c046ac37a9
commit e42705280c
4 changed files with 159 additions and 8 deletions

View file

@ -2,7 +2,9 @@
CFILES = $(wildcard src/*.c)
OBJFILES = $(CFILES:.c=.o)
OUT = proxy
TESTFILES = $(wildcard tests/*.c)
TESTOUT = $(TESTFILES:.c=)
OUT = yaip
CFLAGS = -Wall
LDLIBS = -lsqlite3
CC = gcc
@ -22,7 +24,14 @@ $(OUT): $(OBJFILES)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $^
tests/%.test: tests/%.test.c tests/munit/munit.c
$(CC) $? -o $@
test-%: tests/%.test
$<
.PHONY: clean
clean:
rm -f $(OBJFILES) $(OUT)
rm -f $(OBJFILES) $(OUT) $(TESTOUT)