implement basic unit testing

This commit is contained in:
2025-03-10 21:21:03 -04:00
parent 60996e3de2
commit 7258ef5810
4 changed files with 85 additions and 17 deletions

View File

@@ -5,6 +5,7 @@
IDIR = ./include
BDIR = ./build
SDIR = ./src
TDIR = ./tests
include config.mk
@@ -34,6 +35,9 @@ lib: $(SDIR)/libglacier.c
$(CC) $(SDIR)/libglacier.c -c $(LIBFLAGS) -o $(BDIR)/lib/libglacier.o
$(AR) -rc $(BDIR)/lib/libglacier.a build/lib/libglacier.o
test: $(BDIR) $(TDIR)/Makefile
make -f tests/Makefile
install_lib: $(BDIR)/lib/libglacier.a
@echo "[INFO]"
@echo "[INFO] Installing library to PREFIX/lib..."
@@ -59,3 +63,6 @@ install: install_lib install_head
clean:
rm -rf $(BDIR)
distclean: $(BDIR) $(TDIR)/test-suite
rm -rf $(BDIR) $(TDIR)/test-suite