UNIT TESTING WORKS

This commit is contained in:
Liam Waldron 2025-03-10 22:26:24 -04:00
parent 7258ef5810
commit 923df644a0
3 changed files with 5 additions and 13 deletions

View File

@ -35,8 +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
check: $(BDIR) $(TDIR)/unit-tests.c
$(CC) tests/unit-tests.c -o tests/test-suite -lcunit -Wall -Wextra build/lib/libglacier.a $(LIBFLAGS)
tests/test-suite
install_lib: $(BDIR)/lib/libglacier.a
@echo "[INFO]"
@ -64,5 +65,5 @@ install: install_lib install_head
clean:
rm -rf $(BDIR)
distclean: $(BDIR) $(TDIR)/test-suite
distclean:
rm -rf $(BDIR) $(TDIR)/test-suite

View File

@ -5,6 +5,6 @@
CC = /bin/gcc
AR = /bin/ar
LIBFLAGS = -lconfig
LIBFLAGS = -lconfig -lcrypto
PREFIX = /usr

View File

@ -1,9 +0,0 @@
#
# Makefile
#
include ../config.mk
all: unit-tests.c
$(CC) unit-tests.c -o test-suite -lcunit -lconfig ../build/libglacier.a -Wall -Wextra
./test-suite