]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Detect failures when running multiple tests
authorFred Sundvik <fsundvik@gmail.com>
Sat, 27 Aug 2016 11:53:57 +0000 (14:53 +0300)
committerFred Sundvik <fsundvik@gmail.com>
Sat, 27 Aug 2016 18:57:49 +0000 (21:57 +0300)
Also add better output.

Makefile
message.mk

index 5f5c46860cf16030ec3fe5bdc060b671976339ac..b7ef5f92a3ef10e473885065c6a955b9a6160f9a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -415,7 +415,15 @@ define BUILD_TEST
     MAKE_MSG := $$(MSG_MAKE_TEST)
     $$(eval $$(call BUILD))
     TEST_EXECUTABLE := $$(TEST_DIR)/$$(TEST_NAME).elf
-    TESTS += $$(TEST_EXECUTABLE)
+    TESTS += $$(TEST_NAME)
+    TEST_MSG := $$(MSG_TEST)
+    $$(TEST_NAME)_COMMAND := \
+        printf "$$(TEST_MSG)\n"; \
+        $$(TEST_EXECUTABLE); \
+        if [ $$$$? -gt 0 ]; \
+            then error_occured=1; \
+        fi; \
+        printf "\n";
 endef
 
 define PARSE_TEST
@@ -472,7 +480,8 @@ $(SUBPROJECTS): %: %-allkm
        +error_occured=0; \
        $(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) \
        if [ $$error_occured -gt 0 ]; then printf "$(MSG_ERRORS)" & exit $$error_occured; fi;\
-       $(foreach TEST,$(TESTS),$(TEST);)
+       $(foreach TEST,$(TESTS),$($(TEST)_COMMAND)) \
+       if [ $$error_occured -gt 0 ]; then printf "$(MSG_ERRORS)" & exit $$error_occured; fi;\
 
 # All should compile everything
 .PHONY: all
index 96814986b5b36c1401c2bbb2c5b959fe76f8ba3b..fa051fd712543f7676c7445b1f2b352aabeda174 100644 (file)
@@ -76,3 +76,4 @@ define GENERATE_MSG_MAKE_TEST
     endif
 endef
 MSG_MAKE_TEST = $(eval $(call GENERATE_MSG_MAKE_TEST))$(MSG_MAKE_TEST_ACTUAL)
+MSG_TEST = Testing $(BOLD)$(TEST_NAME)$(NO_COLOR)