Skip to content

Commit

Permalink
Detect failures when running multiple tests
Browse files Browse the repository at this point in the history
Also add better output.
  • Loading branch information
fredizzimo committed Aug 27, 2016
1 parent ffb0a12 commit 7eefb34
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions message.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 7eefb34

Please sign in to comment.