From d699849b2360f90c61f645c5d4d4232cd3e1c962 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Sat, 21 Feb 2026 12:39:20 +0100 Subject: Initial commit: libft Part 1 with tests and documentation Reimplements 24 libc functions with Doxygen-documented header and test suite comparing against libc. --- tests/Makefile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/Makefile (limited to 'tests/Makefile') 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 -- cgit v1.2.3