commit ab4c94ae749c7b5d58dbc5c515221ae9e8d33519 Author: lalgarra Date: Wed Oct 22 21:49:32 2025 +0200 Just starting diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..19fc61f --- /dev/null +++ b/Makefile @@ -0,0 +1,106 @@ +# **************************************************************************** # +# # +# ::: :::::::: # +# Makefile :+: :+: :+: # +# +:+ +:+ +:+ # +# By: lalgarra +#+ +:+ +#+ # +# +#+#+#+#+#+ +#+ # +# Created: 2025/10/22 20:41:03 by lalgarra #+# #+# # +# Updated: 2025/10/22 21:47:50 by lalgarra ### ########.fr # +# # +# **************************************************************************** # + +NAME = report + +# Relative location of sources to test +LIBDIR = ../repo_algarra + +SOURCES = get_next_line.c +OBJECTS = $(SOURCES:.c=.o) + +#SRCBONUS = test_printf_bonus.c +#OBJBONUS = $(SRCBONUS:.c=.o) + +CFLAGS += -Wall -Wextra -Werror -g3 -iquote $(LIBDIR) -O0 + +#%.o: %.c +# $(CC) $(CFLAGS) -c -o $* + +test001: test001.c $(LIBDIR)/get_next_line.c + $(CC) $(CFLAGS) $+ -o $@ + +#$(NAME): $(OBJECTS) $(LIBDIR)/libftprintf.a +# $(CC) $(CFLAGS) $(OBJECTS) -L$(LIBDIR) -lftprintf -o $(NAME) +# +#$(LIBDIR)/libftprintf.a: +# $(MAKE) -C $(LIBDIR) all +# +#bonus: $(OBJBONUS) +# $(MAKE) -C $(LIBDIR) fclean bonus +# $(CC) $(CFLAGS) $(OBJBONUS) -L$(LIBDIR) -lftprintf -o $@ +# +#.PHONY: clean fclean re +# +#clean: +##removes objects (.o)# +# rm -f $(OBJECTS) $(OBJBONUS) +# $(MAKE) -C $(LIBDIR) clean + +fclean: + rm -f test001 + +#all: $(NAME) +## builds all +# +#re: fclean all +## cleans and rebuild all +# +## +##CFLAGS += -Wall -Wextra -Werror -g3 -iquote $(LIBDIR) \ +## -O0 +## +##TESTS := ft_isalpha_test ft_isdigit_test ft_isalnum_test ft_isascii_test \ +## ft_isprint_test ft_toupper_test ft_tolower_test ft_strlen_test \ +## ft_memset_test ft_bzero_test ft_memcpy_test ft_calloc_test \ +## ft_memmove_test ft_strlcpy_test ft_strlcat_test ft_strchr_test \ +## ft_strrchr_test ft_strncmp_test ft_memcmp_test ft_strnstr_test \ +## ft_atoi_test ft_substr_test ft_strjoin_test ft_strtrim_test \ +## ft_split_test +## +##TESTSBONUS := ft_lstclear_test +## +##%_test : %_test.c +## $(CC) $(CFLAGS) $*_test.c -L$(LIBDIR) -lft -o $*_test +## +##%_actual.output : %_test +## @./$*_test 2>&1 > ./$*_actual.output ; +## +###alternative command +### @script -qc './$*_test &> ./$*_actual.output' 2> ./$*_actual.output 1> /dev/null +## +##%_report : %_test %_actual.output +## -(diff -a $*_expected.output $*_actual.output \ +## && echo "Test OK") > $*_report +## +##EXES = $(TESTS) +## +##ACT_OUTPUTS = $(TESTS:_test=_actual.output) +## +##ACT_REPORTS = $(TESTS:_test=_report) +## +##.SECONDARY = $(ACT_REPORTS) $(ACT_OUTPUTS) +## +### Rule to create a 'report' file with info about the execution of +### tests in $(TEST) +##report : $(EXES) $(ACT_OUTPUTS) $(ACT_REPORTS) +## @rm -f report ; +## @$(foreach E, $(TESTS), \ +## $(eval T = $(subst _test,,$(E))) \ +## $(eval R = $(subst _test,_report,$(E))) \ +## echo "=== $(T) ===" >> report ; \ +## cat $(R) >> report ; \ +## ) +## +##fclean: +## rm -f report $(ACT_REPORTS) $(ACT_OUTPUTS) $(EXES) +## diff --git a/test001.c b/test001.c new file mode 100644 index 0000000..a5aa930 --- /dev/null +++ b/test001.c @@ -0,0 +1,22 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* test001.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: lalgarra +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2025/10/22 20:50:52 by lalgarra #+# #+# */ +/* Updated: 2025/10/22 21:12:07 by lalgarra ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include "get_next_line.h" + +int main(int argc, char *argv[]) +{ + (void) argc; + (void) argv; + printf("get_next_line():%s", get_next_line(0)); + return (0); +}