From 59c84b0460418983b0e655fd9fbba34e19b10291 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Fri, 5 Jan 2018 20:07:03 -0500 Subject: Started writing unit tests Added some tests for good input. Also fixed a bug where an empty loop would crash. --- Makefile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 635ab1d..f0200f7 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,10 @@ -CFLAGS = -I. -L. -std=c99 -pedantic -Wall -Werror -O3 +CFLAGS = -I. -L. -std=c99 -pedantic -Wall -Werror -O3 -g CC = gcc LIBNAME = libctemplates.a +BIN_POSTFIX = .exe + + +TEST_1_NAME = t\test_1$(BIN_POSTFIX) $(LIBNAME): ctemplates.o fbuf.o kmp.o hashmap.o ar rc $(LIBNAME) ctemplates.o fbuf.o kmp.o hashmap.o @@ -21,8 +25,11 @@ hashmap.o: hashmap.c hashmap.h clean: rm -f *.o *.a template -test: - cd t; ./test.sh +$(TEST_1_NAME): t\test_1.c $(LIBNAME) + $(CC) $(CFLAGS) -o t\test_1.exe t\test_1.c -lctemplates + +test: $(TEST_1_NAME) + $(TEST_1_NAME) install: $(LIBNAME) cp $(LIBNAME) /usr/local/lib -- cgit v1.2.3-70-g09d2