From 99ed473acb47cb0cda47032e3d2392beca569d59 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Fri, 10 Aug 2012 14:10:34 -0400
Subject: [PATCH] Fix pgtest to return proper error code based on 'make' return
 code.

---
 src/tools/pgtest | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/tools/pgtest b/src/tools/pgtest
index ffb528302db..c160f583209 100755
--- a/src/tools/pgtest
+++ b/src/tools/pgtest
@@ -20,6 +20,10 @@ TMP="/tmp/$$"
 
 [ "X$1" != "X-n" ] && PGCLEAN=clean
 
+# run make check, capture return code in $TMP/ret, then display
+# that but capture it in $TMP/0 too, and return original make
+# error code.  If that succeded, display captured warnings
+
 ($MAKE $PGCLEAN check 2>&1; echo "$?" > $TMP/ret) |
 	(tee  $TMP/0; exit `cat $TMP/ret`) &&
 cat $TMP/0 |
@@ -29,3 +33,6 @@ grep -i warning |
 grep -v setproctitle |
 grep -v find_rule |
 grep -v yy_flex_realloc
+
+# return original make error code
+exit `cat $TMP/ret`
-- 
GitLab