Blame SOURCES/0470-test-Makefile-proper-return-code-for-make-check.patch

712866
From aa40b82145ecc923edfade8149c2ba892bfb664d Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Fri, 11 Nov 2016 12:18:06 +0100
712866
Subject: [PATCH] test/Makefile: proper return code for "make check"
712866
712866
---
712866
 test/Makefile | 7 ++++---
712866
 1 file changed, 4 insertions(+), 3 deletions(-)
712866
712866
diff --git a/test/Makefile b/test/Makefile
5c6c2a
index f71f8540..eaa944fb 100644
712866
--- a/test/Makefile
712866
+++ b/test/Makefile
712866
@@ -2,13 +2,14 @@
712866
 
712866
 check:
712866
 	@[ "$$EUID" == "0" ] || { echo "'check' must be run as root! Please use 'sudo'."; exit 1; }
712866
-	@for i in TEST-[0-9]*; do \
712866
+	@{ ret=0; \
712866
+	for i in TEST-[0-9]*; do \
712866
 		[ -d $$i ] || continue ; \
712866
 		[ -f $$i/Makefile ] || continue ; \
712866
 		if [ -n "$$TESTS" ]; then t=$${i##TEST-}; t=$${t%%-*}; [ "$${TESTS#*$$t*}" != "$$TESTS" ] || continue; fi; \
712866
 		if [ -n "$$SKIP" ]; then t=$${i##TEST-}; t=$${t%%-*}; [ "$${SKIP#*$$t*}" != "$$SKIP" ] && continue; fi; \
712866
-		$(MAKE) -C $$i all ; \
712866
-	done
712866
+		$(MAKE) -C $$i all ; ret=$$((ret + $$?)); \
712866
+	done; exit $$ret; }
712866
 
712866
 clean:
712866
 	@for i in TEST-[0-9]*; do \