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

[PATCH 1/3] Don't allow git-describe failures to go unnoticed in t6120

From
Shawn O. Pearce <spearce@spearce.org>
Date
Mar 4, 2008, 01:09 UTC
Message-ID
<20080304010931.GA15791@spearce.org>

If git-describe fails we never execute the test_expect_success, so we never actually test for failure. This is horribly wrong. We need to always run the test case, but the test case is only supposed to succeed if the prior git-describe returned 0.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 t/t6120-describe.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/t/t6120-describe.sh b/t/t6120-describe.sh
index a7557bd..ba9ea60 100755
--- a/t/t6120-describe.sh
+++ b/t/t6120-describe.sh
@@ -15,8 +15,10 @@ test_description='test describe
 check_describe () {
 	expect="$1"
 	shift
-	R=$(git describe "$@") &&
+	R=$(git describe "$@")
+	S=$?
 	test_expect_success "describe $*" '
+	test $S = 0 &&
 	case "$R" in
 	$expect)	echo happy ;;
 	*)	echo "Oops - $R is not $expect";
-- 
1.5.4.3.529.gb25fb
Message 1 of 1 in “Don't allow git-describe failures to go unnoticed in t6120”
  1. 1/3 Don't allow git-describe failures to go unnoticed in t6120Shawn O. Pearce, Mar 4, 2008

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.