git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/4] tests: notice valgrind error in test_must_fail

From
Thomas Rast <trast@inf.ethz.ch>
Date
Mar 31, 2013, 08:37 UTC
Message-ID
<9a01760dc54167047b17a1fdbb456055c3a9b1cd.1364718866.git.trast@inf.ethz.ch>
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
Previous: Thomas RastNext: Johannes Schindelin
Message 5 of 6 in “tests: --valgrind=tool”
  1. 0/3 tests: --valgrind=toolThomas Rast, Mar 31, 2013
  2. 1/3 t/README: --valgrind already implies -vThomas Rast, Mar 31, 2013
  3. 2/3 tests: parameterize --valgrind optionThomas Rast, Mar 31, 2013
  4. 3/3 tests --valgrind: provide a mode without --track-originsThomas Rast, Mar 31, 2013
  5. 3/4 tests: notice valgrind error in test_must_failThomas Rast, Mar 31, 2013
  6. Johannes SchindelinApr 1, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.