diff dovecot.m4 @ 18757:5e523f0bbdf8

dovecot.m4: If run-test.sh fails, print the failing command to stderr. Currently otherwise the way Dovecot tests are run it's not clearly visible.
author Timo Sirainen <tss@iki.fi>
date Fri, 29 May 2015 11:08:29 +0300
parents 2dd8308f5d57
children 74fb129251e2
line wrap: on
line diff
--- a/dovecot.m4	Fri May 29 10:43:38 2015 +0300
+++ b/dovecot.m4	Fri May 29 11:08:29 2015 +0300
@@ -6,7 +6,7 @@
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 
-# serial 15
+# serial 16
 
 AC_DEFUN([DC_DOVECOT_MODULEDIR],[
 	AC_ARG_WITH(moduledir,
@@ -40,20 +40,24 @@
 shift
 
 if test "\$NOVALGRIND" != ""; then
-  exec \$[*]
+  \$[*]
+  ret=\$?
+else
+  trap "rm -f test.out.\$\$" 0 1 2 3 15
+  supp_path="\$top_srcdir/run-test-valgrind.supp"
+  if test -r "\$supp_path"; then
+    valgrind -q --suppressions="\$supp_path" --log-file=test.out.\$\$ \$[*]
+  else
+    valgrind -q --log-file=test.out.\$\$ \$[*]
+  fi
+  ret=\$?
+  if test -s test.out.\$\$; then
+    cat test.out.\$\$
+    ret=1
+  fi
 fi
-
-trap "rm -f test.out.\$\$" 0 1 2 3 15
-supp_path="\$top_srcdir/run-test-valgrind.supp"
-if test -r "\$supp_path"; then
-  valgrind -q --suppressions="\$supp_path" --log-file=test.out.\$\$ \$[*]
-else
-  valgrind -q --log-file=test.out.\$\$ \$[*]
-fi
-ret=\$?
-if test -s test.out.\$\$; then
-  cat test.out.\$\$
-  exit 1
+if test \$ret != 0; then
+  echo "Failed to run: \$[*]" >&2
 fi
 exit \$ret
 EOF