aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile48
-rw-r--r--test/include/libft_test.h8
-rwxr-xr-xtest/libft_testbin0 -> 34012 bytes
-rw-r--r--test/src/runner/test_ft_strlen_runner.c6
-rw-r--r--test/src/str/test_ft_strlen.c14
5 files changed, 76 insertions, 0 deletions
diff --git a/test/Makefile b/test/Makefile
new file mode 100644
index 0000000..4d84321
--- /dev/null
+++ b/test/Makefile
@@ -0,0 +1,48 @@
+MAKE = make
+MAKE_ARGS = --no-print-directory
+
+UNITY_DIR = ../vendor/_unity
+LIBFT_DIR = ..
+
+SRC_DIR = src
+INCLUDE_DIR = include
+
+CC = gcc
+CCFLAGS = -I$(INCLUDE_DIR) -I$(UNITY_DIR)/include -I$(LIBFT_DIR)/include -Wall -Wextra -Werror
+LDFLAGS = -L$(UNITY_DIR) -lunity -L$(LIBFT_DIR) -lft
+
+NAME = libft_test
+
+SRC = $(shell find $(SRC_DIR) -type f -name "*.c")
+OBJ = $(SRC:.c=.o)
+
+
+all: unity_all $(NAME)
+
+run: all
+ @echo "Test: Running"
+ @./$(NAME)
+
+$(NAME): $(OBJ)
+ @echo "Test: Linking: $@"
+ @$(CC) -o $@ $^ $(LDFLAGS)
+
+%.o: %.c
+ @echo "Test: Compiling: $@"
+ @$(CC) $(CCFLAGS) -c -o $@ $<
+
+clean: unity_fclean
+ @echo "Test: Removing object"
+ @$(RM) $(OBJ)
+
+fclean:
+ @echo "Test: Removing executable"
+ @$(RM) $(NAME)
+
+re: fclean all
+
+unity_all:
+ @$(MAKE) $(MAKE_ARGS) -s -C $(UNITY_DIR) all
+
+unity_fclean:
+ @$(MAKE) $(MAKE_ARGS) -s -C $(UNITY_DIR) fclean
diff --git a/test/include/libft_test.h b/test/include/libft_test.h
new file mode 100644
index 0000000..1c5ebb5
--- /dev/null
+++ b/test/include/libft_test.h
@@ -0,0 +1,8 @@
+#ifndef LIBFT_TEST_H
+# define LIBFT_TEST_H
+
+# include "unity.h"
+# include "unity_fixture.h"
+# include "libft.h"
+
+#endif
diff --git a/test/libft_test b/test/libft_test
new file mode 100755
index 0000000..13cbab2
--- /dev/null
+++ b/test/libft_test
Binary files differ
diff --git a/test/src/runner/test_ft_strlen_runner.c b/test/src/runner/test_ft_strlen_runner.c
new file mode 100644
index 0000000..368c033
--- /dev/null
+++ b/test/src/runner/test_ft_strlen_runner.c
@@ -0,0 +1,6 @@
+#include "libft_test.h"
+
+TEST_GROUP_RUNNER(ft_strlen)
+{
+ RUN_TEST_CASE(ft_strlen, yo);
+}
diff --git a/test/src/str/test_ft_strlen.c b/test/src/str/test_ft_strlen.c
new file mode 100644
index 0000000..1e4e1c4
--- /dev/null
+++ b/test/src/str/test_ft_strlen.c
@@ -0,0 +1,14 @@
+#include "libft_test.h"
+
+TEST_GROUP(ft_strlen);
+
+TEST_SETUP(ft_strlen)
+{}
+
+TEST_TEAR_DOWN(ft_strlen)
+{}
+
+TEST(ft_strlen, yo)
+{
+ TEST_ASSERT_EQUAL(0, 0);
+}