threads / patch / 12472

patch, 3 partsDon't allow git-describe failures to go unnoticed in t6120

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

## tl;dr

One message between Mar 4, 2008 and Mar 4, 2008. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Shawn O. Pearce· Mar 4, 2008, 01:09 UTC · lore

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(-)
Show changes to t/t6120-describe.sh +3 −1
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

← back to recent threads