diff options
Diffstat (limited to 'tests/Makefile')
| -rw-r--r-- | tests/Makefile | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 0000000..319fa22 --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,31 @@ +CC = cc +CFLAGS = +LIB = ../libft.a + +TESTS = test_strlen test_is test_mem test_cmp test_case test_strl test_search \ + test_atoi test_alloc + +all: $(TESTS) + @for t in $(TESTS); do \ + echo "--- Running $$t ---"; \ + ./$$t; \ + done + +test_%: test_%.c $(LIB) + $(CC) $(CFLAGS) -o $@ $< $(LIB) + +# Tests comparing against BSD functions (strlcpy, strlcat, strnstr) +# need -lbsd since these are not part of glibc by default. +test_strl: test_strl.c $(LIB) + $(CC) $(CFLAGS) -o $@ $< $(LIB) -lbsd + +test_search: test_search.c $(LIB) + $(CC) $(CFLAGS) -o $@ $< $(LIB) -lbsd + +$(LIB): + $(MAKE) -C .. + +clean: + rm -f $(TESTS) + +.PHONY: all clean |
