mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
fix(tests): also run tests if test program did not change
This commit is contained in:
parent
25369f02ab
commit
fc985ea046
1 changed files with 7 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue