git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@inf.ethz.ch>
To: <git@vger.kernel.org>
Cc: "Johannes Schindelin" <johannes.schindelin@gmx.de>,
	"Jeff King" <peff@peff.net>, "Carlos Martín Nieto" <cmn@elego.de>
Subject: [PATCH 3/4] tests: notice valgrind error in test_must_fail
Date: Sun, 31 Mar 2013 10:37:25 +0200	[thread overview]
Message-ID: <9a01760dc54167047b17a1fdbb456055c3a9b1cd.1364718866.git.trast@inf.ethz.ch> (raw)
In-Reply-To: <cover.1364716452.git.trast@inf.ethz.ch>

We tell valgrind to return 126 if it notices that something is wrong,
but we did not actually handle this in test_must_fail, leading to
false negatives.  Catch and report it.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
---

Just noticed this issue when tracking down the failure in t7612.  It
might still be a bit too fragile; when running the entire suite under
valgrind, I usually just

  cd test-results
  egrep '^==[0-9]+==' *.out| less -S


 t/test-lib-functions.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index fa62d01..6766553 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -536,6 +536,9 @@ test_must_fail () {
 	elif test $exit_code = 127; then
 		echo >&2 "test_must_fail: command not found: $*"
 		return 1
+	elif test $exit_code = 126; then
+		echo >&2 "test_must_fail: valgrind error: $*"
+		return 1
 	fi
 	return 0
 }
-- 
1.8.2.467.gedf93a5

  parent reply	other threads:[~2013-03-31  8:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-31  8:00 [PATCH 0/3] tests: --valgrind=tool Thomas Rast
2013-03-31  8:00 ` [PATCH 1/3] t/README: --valgrind already implies -v Thomas Rast
2013-03-31  8:00 ` [PATCH 2/3] tests: parameterize --valgrind option Thomas Rast
2013-03-31  8:00 ` [PATCH 3/3] tests --valgrind: provide a mode without --track-origins Thomas Rast
2013-03-31  8:37 ` Thomas Rast [this message]
2013-04-01 14:27 ` [PATCH 0/3] tests: --valgrind=tool Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a01760dc54167047b17a1fdbb456055c3a9b1cd.1364718866.git.trast@inf.ethz.ch \
    --to=trast@inf.ethz.ch \
    --cc=cmn@elego.de \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).