From fc985ea046923b0dec69bd7d68c59ef87e5fb5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kha=C3=AFs=20COLIN?= Date: Fri, 14 Feb 2025 13:30:18 +0100 Subject: [PATCH] fix(tests): also run tests if test program did not change --- tests/Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index 585b288..a3a992e 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -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)