valgrind tests
This commit is contained in:
parent
1f049159f5
commit
9f4413439d
|
@ -1,10 +1,12 @@
|
||||||
SRC = main.c \
|
SRC = main.c \
|
||||||
ft_lib.c \
|
ft_lib.c \
|
||||||
ft_io.c
|
ft_io.c \
|
||||||
|
argparse.c
|
||||||
HEADERS = main.h \
|
HEADERS = main.h \
|
||||||
ft_lib.h \
|
ft_lib.h \
|
||||||
ft_io.h \
|
ft_io.h \
|
||||||
colors.h
|
colors.h \
|
||||||
|
argparse.h
|
||||||
|
|
||||||
OBJDIR = obj
|
OBJDIR = obj
|
||||||
INCDIR = include
|
INCDIR = include
|
||||||
|
@ -47,7 +49,7 @@ $(NAME): $(OBJ)
|
||||||
$(OBJ): | $(OBJDIR)
|
$(OBJ): | $(OBJDIR)
|
||||||
|
|
||||||
$(OBJDIR)/%.o: %.c $(DEPS)
|
$(OBJDIR)/%.o: %.c $(DEPS)
|
||||||
@#norminette $< >/dev/null || { printf '\033[107;41m%s\033[m\n' "!Norminette Failed>>>"; norminette $<; printf '\033[107;41m%s\033[m\n' "<<<Norminette Failed!"; exit 1; }
|
@#norminette $< >/dev/null || { printf '\033[102;97m%s\033[m\n' "!Norminette Failed>>>"; norminette $<; printf '\033[101;97m%s\033[m\n' "<<<Norminette Failed!"; exit 1; }
|
||||||
@$(CC) $(CFLAGS) -c $< -o $@
|
@$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
$(OBJDIR):
|
$(OBJDIR):
|
||||||
|
@ -57,10 +59,14 @@ tests: test
|
||||||
|
|
||||||
test: re run fclean
|
test: re run fclean
|
||||||
|
|
||||||
SUCCESS_MSG=printf '\n\033[32m --- %s --- \033[m\n\n' "Test passed!"
|
SUCCESS_MSG=printf '\n\033[102;30m --- %s --- \033[m\n\n' "Test passed!"
|
||||||
FAIL_MSG=printf '\n\033[31m --- %s --- \033[m\n\n' "Test failed!"
|
FAIL_MSG=printf '\n\033[101;30m --- %s --- \033[m\n\n' "Test failed!"
|
||||||
|
SUCCESS_MSG_VALG=printf '\n\033[102;97m --- %s --- \033[m\n\n' "Valgrind ran without errors!"
|
||||||
|
FAIL_MSG_VALG=printf '\n\033[101;97m --- %s --- \033[m\n\n' "Valgrind Failed!"
|
||||||
SUCCESS=&& $(SUCCESS_MSG) || $(FAIL_MSG)
|
SUCCESS=&& $(SUCCESS_MSG) || $(FAIL_MSG)
|
||||||
|
SUCCESS_VALG=&& $(SUCCESS_MSG_VALG) || $(FAIL_MSG_VALG)
|
||||||
FAIL=&& $(FAIL_MSG) || $(SUCCESS_MSG)
|
FAIL=&& $(FAIL_MSG) || $(SUCCESS_MSG)
|
||||||
|
VALGRIND=valgrind --leak-check=full --error-exitcode=1
|
||||||
run:
|
run:
|
||||||
@clear
|
@clear
|
||||||
./$(NAME) $(SUCCESS)
|
./$(NAME) $(SUCCESS)
|
||||||
|
@ -69,3 +75,7 @@ run:
|
||||||
./$(NAME) 1 "./dicts/numbers2.dict" $(FAIL)
|
./$(NAME) 1 "./dicts/numbers2.dict" $(FAIL)
|
||||||
./$(NAME) 1 "./dicts/numb.dict" $(FAIL)
|
./$(NAME) 1 "./dicts/numb.dict" $(FAIL)
|
||||||
./$(NAME) 1 2 3 $(FAIL)
|
./$(NAME) 1 2 3 $(FAIL)
|
||||||
|
|
||||||
|
valgrind:
|
||||||
|
$(VALGRIND) ./$(NAME) 1 $(SUCCESS_VALG)
|
||||||
|
$(VALGRIND) ./$(NAME) "./dicts/numbers2.dict" 1 $(SUCCESS_VALG)
|
||||||
|
|
Loading…
Reference in New Issue