From 41891506f6869526d46e96ff23d3b7b8f7ed96c9 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Thu, 29 Oct 2015 01:11:28 -0700 Subject: Do not stop build-all after a failed sample. Instead, continue until the end and provide a summary (PASS/XFAIL/FAIL) at the end. If there are any FAILs, exit with code 1. Signed-off-by: Alexey Neyman diff --git a/samples/samples.mk b/samples/samples.mk index 48f4a74..7f5a36c 100644 --- a/samples/samples.mk +++ b/samples/samples.mk @@ -189,8 +189,16 @@ define build_sample $(SILENT)if [ ! -z "$(call host_triplet,$(1))" -a -d "$(call prefix_dir,$(call host_triplet,$(1)))" ]; then \ PATH="$$PATH:$(call prefix_dir,$(call host_triplet,$(1)))/bin"; \ fi; \ - $(MAKE) -rf $(CT_NG) V=0 build - @printf '\r' + if $(MAKE) -rf $(CT_NG) V=0 build; then \ + status=PASS; \ + elif [ -e $(call sample_dir,$(1))/broken ]; then \ + status=XFAIL; \ + else \ + status=FAIL; \ + fi; \ + printf '\r %-5s %s\n' $$status '$(1)'; \ + mkdir -p .build-all/$$status/$(1); \ + bzip2 < build.log > .build-all/$$status/$(1)/build.log.bz2 endef # ---------------------------------------------------------- @@ -218,7 +226,27 @@ CT_SAMPLES_CANADIAN = $(strip $(foreach s,$(CT_SAMPLES),$(if $(findstring $(__co # Build all samples; first, build simple cross as canadian configurations may depend on # build-to-host cross being pre-built. -build-all: $(patsubst %,build-%,$(CT_SAMPLES_CROSS) $(CT_SAMPLES_CANADIAN)) +build-all: build-all-pre $(patsubst %,build-%,$(CT_SAMPLES_CROSS) $(CT_SAMPLES_CANADIAN)) + @echo + @if [ -d .build-all/PASS ]; then \ + echo 'Success:'; \ + (cd .build-all/PASS && ls | sed 's/^/ - /'); \ + echo; \ + fi + @if [ -d .build-all/XFAIL ]; then \ + echo 'Expected failure:'; \ + (cd .build-all/XFAIL && ls | sed 's/^/ - /'); \ + echo; \ + fi + @if [ -d .build-all/FAIL ]; then \ + echo 'Failure:'; \ + (cd .build-all/FAIL && ls | sed 's/^/ - /'); \ + echo; \ + fi + @[ ! -d .build-all/FAIL ] + +build-all-pre: + @rm -rf .build-all # Build all samples, overiding the number of // jobs per sample build-all.%: -- cgit v0.10.2-6-g49f6