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