summaryrefslogtreecommitdiff
path: root/t/t0000-basic.sh
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2010-08-11 12:04:38 +0000
committerJunio C Hamano <gitster@pobox.com>2010-08-18 12:42:04 -0700
commitce60653e59f89b409b80a1a381275914fddce07f (patch)
treee4b87ac4e721e095ecc3323b415cb38f3d17b321 /t/t0000-basic.sh
parentc91cfd19160be63e97f28dce8c9af421b61c9938 (diff)
downloadgit-ce60653e59f89b409b80a1a381275914fddce07f.tar.gz
test-lib: Multi-prereq support only checked the last prereq
The support for multiple test prerequisites added by me in "test-lib: Add support for multiple test prerequisites" was broken. The for iterated over each prerequisite and returned true/false within a case statement, but since it missed a return statement only the last prerequisite in the list of prerequisites was ever considered, the rest were ignored. Fix that by changing the test_have_prereq code to something less clever that keeps a count of the total prereqs and the ones we have and compares the count at the end. This comes with the added advantage that it's easy to list the missing prerequisites in the test output, implement that while I'm at it. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0000-basic.sh')
-rwxr-xr-xt/t0000-basic.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index 2887677391..960208504b 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -84,7 +84,11 @@ donthaveit=yes
test_expect_success HAVEIT,DONTHAVEIT 'unmet prerequisites causes test to be skipped' '
donthaveit=no
'
-if test $haveit$donthaveit != yesyes
+donthaveiteither=yes
+test_expect_success DONTHAVEIT,HAVEIT 'unmet prerequisites causes test to be skipped' '
+ donthaveiteither=no
+'
+if test $haveit$donthaveit$donthaveiteither != yesyesyes
then
say "bug in test framework: multiple prerequisite tags do not work reliably"
exit 1