diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-01-30 10:36:49 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-01-30 10:36:49 +0100 |
| commit | aa9613efb6fb39bd96fc4836b5d38c3746af1b15 (patch) | |
| tree | 0fac2b661a860b3ca2e3effa868384290064f708 /test | |
| parent | fe37597119353ce183fc404417b81bd4702f64b7 (diff) | |
| download | libft-aa9613efb6fb39bd96fc4836b5d38c3746af1b15.tar.gz libft-aa9613efb6fb39bd96fc4836b5d38c3746af1b15.tar.bz2 libft-aa9613efb6fb39bd96fc4836b5d38c3746af1b15.zip | |
hash table draft
Diffstat (limited to 'test')
| -rw-r--r-- | test/Makefile | 52 | ||||
| m--------- | test/ctest | 0 | ||||
| -rw-r--r-- | test/main_test.c | 7 | ||||
| -rw-r--r-- | test/str/ft_strlen_test.c | 34 | ||||
| -rw-r--r-- | test/test_libft.h | 9 |
5 files changed, 0 insertions, 102 deletions
diff --git a/test/Makefile b/test/Makefile deleted file mode 100644 index 3f31059..0000000 --- a/test/Makefile +++ /dev/null @@ -1,52 +0,0 @@ -MAKE_ARGS = --no-print-directory - -NAME = test_libft - -BUILD_DIR = build -LIBFT_DIR = .. -CTEST_DIR = ctest - -CC = gcc -CCFLAGS = -Wall -Wextra -I$(LIBFT_DIR)/include -I$(CTEST_DIR) -LDFLAGS = -L$(LIBFT_DIR) -lft - -HEADER = $(shell find . -name "*.h") -SRC = $(shell find . -name "*_test.c") -SRC += $(shell find $(CTEST_DIR) -name "*.c") -OBJ = $(SRC:%.c=$(BUILD_DIR)/%.o) - -all: make_build_dirs $(NAME) - -run_raw: all - @./$(NAME) - -make_build_dirs: - @for dir in $$(find . -not -path "*build*" -type d | sed 's/.*/$(BUILD_DIR)\/&/'); \ - do \ - if [ ! -d "$$dir" ]; then \ - mkdir -p $$dir; echo "Making build dir: $$dir"; fi \ - done - -$(NAME): $(OBJ) libft_all - @echo "Test: Linking $@" - @$(CC) -o $@ $(OBJ) $(LDFLAGS) - -$(BUILD_DIR)/%.o: %.c $(HEADER) - @echo "Test: Compiling: $@" - @$(CC) $(CCFLAGS) -c -o $@ $< - -clean: - @echo "Test: Removing objects" - @$(RM) -r $(BUILD_DIR) - -fclean: clean - @echo "Test: Removing library" - @$(RM) $(NAME) - @echo "Test: Removing libft" - @$(MAKE) $(MAKE_ARGS) -C $(LIBFT_DIR) fclean - -re: fclean all - -libft_all: - @echo "Test: Making libft" - @$(MAKE) $(MAKE_ARGS) -C $(LIBFT_DIR) all diff --git a/test/ctest b/test/ctest deleted file mode 160000 -Subproject ab5906865fab359cbb0a814ef3863bbc1fe5f10 diff --git a/test/main_test.c b/test/main_test.c deleted file mode 100644 index 6b74ac4..0000000 --- a/test/main_test.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "test_libft.h" - -int main(void) -{ - TEST_CALL(ft_strlen); - return 0; -} diff --git a/test/str/ft_strlen_test.c b/test/str/ft_strlen_test.c deleted file mode 100644 index 1c444ba..0000000 --- a/test/str/ft_strlen_test.c +++ /dev/null @@ -1,34 +0,0 @@ -#include <string.h> -#include "libft.h" -#include "ctest.h" - -TEST_SEGV_FUNC(ft_strlen, char *str) -{ - ft_strlen(str); -} -TEST_SEGV_FUNC_END - -ASSERT_FUNC1(ft_strlen, char*, str) -{ - return ft_strlen(str) == strlen(str); -} -ASSERT_FUNC1_END - -ASSERT_PRINT_ARG_FUNC1(ft_strlen, char*, str) -{ - printf("(str: \"%.30s", str); - if (strlen(str) > 30) - fputs("...", stdout); - fputs("\")", stdout); -} -ASSERT_PRINT_ARG_FUNC1_END - - -TEST(ft_strlen) -{ - ASSERT(ft_strlen, CTEST_DEF_EMPTY); - ASSERT(ft_strlen, CTEST_DEF_HELLO); - ASSERT(ft_strlen, CTEST_DEF_HIDDEN); - ASSERT(ft_strlen, CTEST_DEF_FORMAT); - ASSERT(ft_strlen, CTEST_DEF_LOREM_IPSUM); -} diff --git a/test/test_libft.h b/test/test_libft.h deleted file mode 100644 index aa23e54..0000000 --- a/test/test_libft.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef TEST_LIBFT_H -# define TEST_LIBFT_H - -# include "ctest.h" -# include "libft.h" - -TEST(ft_strlen); - -#endif |
