aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2018-01-05 20:07:03 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2018-01-05 20:07:03 -0500
commit59c84b0460418983b0e655fd9fbba34e19b10291 (patch)
tree21dce8b7a1f6c3f4e2eaab3180866f609c5d56d5 /Makefile
parent9c7882627fd28c060f53d86e194fb864302a347c (diff)
downloadlibctemplates-59c84b0460418983b0e655fd9fbba34e19b10291.tar.gz
libctemplates-59c84b0460418983b0e655fd9fbba34e19b10291.tar.bz2
libctemplates-59c84b0460418983b0e655fd9fbba34e19b10291.zip
Started writing unit tests
Added some tests for good input. Also fixed a bug where an empty loop would crash.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 10 insertions, 3 deletions
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