correct valgrind rule
authorMazet Laurent <mazet@softndesign.org>
Wed, 1 Feb 2023 22:31:08 +0000 (23:31 +0100)
committerMazet Laurent <mazet@softndesign.org>
Wed, 1 Feb 2023 22:31:08 +0000 (23:31 +0100)
makefile

index fe42f876049b741bb4e0d4ad1b24cc065d40f75b..25ebdc02b5414be51ec60da4609e689ddbfc587a 100644 (file)
--- a/makefile
+++ b/makefile
@@ -98,18 +98,18 @@ gcov_%:
 
 test_%: %.test %.exe
        IFS=$$'\n'; RC=0; \
-       for test in `cat $< | sed 's,${<:.test=.exe},./${<:.test=.exe},g'`; do \
+       for test in `cat $< | sed 's,${<:.test=.exe},$(VALGRIND) ./${<:.test=.exe},g'`; do \
          echo "=== $$test ==="; \
-         eval $(VALGRIND) $$test; \
+         eval $$test; \
          [ $$? -eq 0 ] && echo -e "\033[1;32mSUCCESS\033[0;0m" \
                        || { echo -e "\033[1;31mFAILED\033[0;0m"; RC=1; }; \
        done; \
        test "$$RC" -ne 1
 
 valgrind_%: %.exe
-       VALGRIND="valgrind -v --leak-check=full --show-reachable=yes --log-fd=2"; \
+       VALGRIND="valgrind -v --leak-check=full --log-fd=3"; \
        export VALGRIND; \
-       $(MAKE) $(@:valgrind_%=test_%)
+       $(MAKE) $(@:valgrind_%=test_%) 3>$@.log
 
 %.d: %.c
        $(call TITLE, "Building $@")