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

[PATCH 3/4] test_must_fail: report number of unexpected signal

From
Jeff King <peff@peff.net>
Date
Feb 24, 2016, 07:45 UTC
Message-ID
<20160224074548.GC9481@sigill.intra.peff.net>
In-Reply-To
<20160224073603.GA9163@sigill.intra.peff.net>

If a command is marked as test_must_fail but dies with a signal, we consider that a problem and report the error to stderr. However, we don't say _which_ signal; knowing that can make debugging easier. Let's share as much as we know.

Signed-off-by: Jeff King <peff@peff.net>
---
Not necessary for the fix, obviously, but I implemented this while
trying to figure out what in the world was going on with the
write_or_die() thing. :)
 t/test-lib-functions.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index c64e5a5..8d99eb3 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -617,7 +617,7 @@ test_must_fail () {
 		return 0
 	elif test $exit_code -gt 129 && test $exit_code -le 192
 	then
-		echo >&2 "test_must_fail: died by signal: $*"
+		echo >&2 "test_must_fail: died by signal $(($exit_code - 128)): $*"
 		return 1
 	elif test $exit_code -eq 127
 	then
-- 
2.7.2.645.g4e1306c
Previous: Jeff KingNext: Jeff King
Message 4 of 5 in “robustifying t5504”
  1. 0/4 robustifying t5504Jeff King, Feb 24, 2016
  2. 1/4 write_or_die: handle EPIPE in async threadsJeff King, Feb 24, 2016
  3. 2/4 fetch-pack: ignore SIGPIPE in sideband demuxerJeff King, Feb 24, 2016
  4. 3/4 test_must_fail: report number of unexpected signalJeff King, Feb 24, 2016
  5. 4/4 t5504: handle expected output from SIGPIPE deathJeff King, Feb 24, 2016

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.