git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] t/test-lib.sh: Let test_must_fail fail on signals only
@ 2008-07-12 15:47 Stephan Beyer
  2008-07-12 15:47 ` [PATCH 2/2] t/: Use "test_must_fail git" instead of "! git" Stephan Beyer
  2008-07-16  5:18 ` [PATCH 1/2] t/test-lib.sh: Let test_must_fail fail on signals only Jeff King
  0 siblings, 2 replies; 15+ messages in thread
From: Stephan Beyer @ 2008-07-12 15:47 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Stephan Beyer

The test_must_fail function in test-lib.sh has been designed
to distinguish segmentation faults from controlled errors.
But in the current implementation this only works if a git
command does not return a small negative value, like -1, -2
or -3. But some git commands do.

Because any signal (like SIGSEGV) will result in an exit status
less than 193, this patch just adds a further check for the exit
status.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
---
 t/test-lib.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 8e2849b..11c0275 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -379,7 +379,7 @@ test_external_without_stderr () {
 
 test_must_fail () {
 	"$@"
-	test $? -gt 0 -a $? -le 129
+	test $? -gt 0 -a $? -le 129 -o $? -gt 192
 }
 
 # test_cmp is a helper function to compare actual and expected output.
-- 
1.5.6.2.303.g79662

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-07-17  7:26 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-12 15:47 [PATCH 1/2] t/test-lib.sh: Let test_must_fail fail on signals only Stephan Beyer
2008-07-12 15:47 ` [PATCH 2/2] t/: Use "test_must_fail git" instead of "! git" Stephan Beyer
2008-07-12 16:04   ` Jakub Narebski
2008-07-12 21:43     ` Stephan Beyer
2008-07-12 21:30   ` [SQUASH PATCH] t9001: " Stephan Beyer
2008-07-16  5:18 ` [PATCH 1/2] t/test-lib.sh: Let test_must_fail fail on signals only Jeff King
2008-07-16  5:54   ` Junio C Hamano
2008-07-17  5:18     ` Jeff King
2008-07-17  5:38       ` Junio C Hamano
2008-07-17  6:01         ` Jeff King
2008-07-17  6:31           ` Junio C Hamano
2008-07-17  6:38             ` Jeff King
2008-07-17  7:22               ` Johannes Sixt
2008-07-17  7:25                 ` Junio C Hamano
2008-07-16 11:57   ` Stephan Beyer

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).