fix(tests): also run tests if test program did not change

This commit is contained in:
Khaïs COLIN 2025-02-14 13:30:18 +01:00
parent 25369f02ab
commit fc985ea046
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo

View file

@ -9,6 +9,7 @@ ifeq ($(CFLAGS),)
CFLAGS = -Wall -Wextra -Werror -g
endif
tests = $(addprefix test_,$(rawtests))
run_tests = $(addprefix run_test_,$(rawtests))
test_objs = $(addsuffix .o,$(tests))
objs := $(addprefix ../,$(objs)) testutil.o
all_objs = $(objs) $(test_objs)
@ -21,10 +22,10 @@ LIBFT = $(LIBFTDIR)libft.a
IFLAGS = -I$(LIBFTDIR)
LINCLUDE = -L$(LIBFTDIR)
.PHONY: run
.PHONY: run fclean run_test_%
.NOTPARALLEL: run
run: $(tests)
run: $(run_tests)
@echo "Finished running C tests"
-include $(deps)
@ -35,10 +36,12 @@ run: $(tests)
test_%: %.o $(objs)
$(CC) $(CFLAGS) -o $@ $*.o $(objs) $(LINCLUDE) $(LDLIBS)
run_test_%: test_%
@echo
@echo "====== Now running test: $@ ======"
@echo "====== Now running test: $* ======"
@echo
./$@
./test_$*
fclean:
rm -f $(tests)