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

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