author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | |
Wed, 11 Aug 2010 12:04:38 +0000 (12:04 +0000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 18 Aug 2010 19:42:04 +0000 (12:42 -0700) | ||
commit | ce60653e59f89b409b80a1a381275914fddce07f | |
tree | e4b87ac4e721e095ecc3323b415cb38f3d17b321 | tree | snapshot |
parent | c91cfd19160be63e97f28dce8c9af421b61c9938 | commit | diff |
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>
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>
t/t0000-basic.sh | diff | blob | history | |
t/test-lib.sh | diff | blob | history |