Skip to content
Snippets Groups Projects
Unverified Commit 8da8c081 authored by Nicolas Tsiftes's avatar Nicolas Tsiftes Committed by GitHub
Browse files

Merge pull request #1769 from pjonsson/detect-failure

tests: ensure cd is successful
parents 7a9f6324 1806db9b
Branches
No related tags found
No related merge requests found
...@@ -39,7 +39,7 @@ get_target_vars = $(wordlist 2,15,$(subst :, ,$1)) ...@@ -39,7 +39,7 @@ get_target_vars = $(wordlist 2,15,$(subst :, ,$1))
define dooneexample define dooneexample
@echo -n Building example $(3): $(1) $(4) for target $(2) @echo -n Building example $(3): $(1) $(4) for target $(2)
@((cd $(EXAMPLESDIR)/$(1); \ @((cd $(EXAMPLESDIR)/$(1) && \
$(MAKE) $(4) TARGET=$(2) clean && make -j $(4) TARGET=$(2) WERROR=1) > \ $(MAKE) $(4) TARGET=$(2) clean && make -j $(4) TARGET=$(2) WERROR=1) > \
/dev/null 2>make.err && \ /dev/null 2>make.err && \
(echo " -> OK" && printf "%-75s %-40s %-20s TEST OK\n" "$(1)" "$(4)" "$(2)" > $(3)-$(subst /,-,$(1))$(2).testlog) || \ (echo " -> OK" && printf "%-75s %-40s %-20s TEST OK\n" "$(1)" "$(4)" "$(2)" > $(3)-$(subst /,-,$(1))$(2).testlog) || \
...@@ -53,16 +53,23 @@ $(call dooneexample,$(dir $(call get_target,${1})),$(notdir $(call get_target,${ ...@@ -53,16 +53,23 @@ $(call dooneexample,$(dir $(call get_target,${1})),$(notdir $(call get_target,${
endef endef
#end of GNU make magic #end of GNU make magic
examples: examples: | $(EXAMPLESDIR)
$(foreach ex, $(EXAMPLES), $(call doexample, ${ex})) $(foreach ex, $(EXAMPLES), $(call doexample, ${ex}))
$(EXAMPLESDIR):
@echo "Could not find examples directory $(EXAMPLESDIR).\n"
@echo "If this failure is when running 19-out-of-tree-builds, clone"
@echo "https://github.com/contiki-ng/out-of-tree-tests into"
@echo "$(EXAMPLESDIR) and run the test again.\n"
@false
summary: examples summary: examples
@cat *.testlog > summary @cat *.testlog > summary
@echo "========== Summary ==========" @echo "========== Summary =========="
@cat summary @cat summary
clean: clean: | $(EXAMPLESDIR)
@rm -f *.testlog summary @rm -f *.testlog summary
@$(foreach example, $(EXAMPLES), \ @$(foreach example, $(EXAMPLES), \
$(foreach target, $(EXAMPLESTARGETS), \ $(foreach target, $(EXAMPLESTARGETS), \
(cd $(EXAMPLESDIR)/$(example); $(MAKE) TARGET=$(target) clean);)) (cd $(EXAMPLESDIR)/$(example) && $(MAKE) TARGET=$(target) clean);))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment