]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t5561: skip tests if curl is not available
authorJeff King <peff@peff.net>
Tue, 3 Apr 2018 14:01:57 +0000 (10:01 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 Apr 2018 07:21:41 +0000 (16:21 +0900)
It's possible to have libcurl installed but not the curl
command-line utility. The latter is not generally needed for
Git's http support, but we use it in t5561 for basic tests
of http-backend's functionality. Let's detect when it's
missing and skip this test.

Note that we can't mark the individual tests with the CURL
prerequisite. They're in a shared t556x_common that uses the
GET and POST functions as a level of indirection, and it's
only our implementations of those functions in t5561 that
requires curl. It's not a problem, though, as literally
every test in the script would depend on the prerequisite
anyway.

Reported-by: Jens Krüger <Jens.Krueger@frm2.tum.de>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5561-http-backend.sh
t/test-lib.sh

index 6167563986b22b08cc13fbacc5546711a4b0d862..84a955770a017e68d0cc1e928929e5a043d64e86 100755 (executable)
@@ -3,6 +3,12 @@
 test_description='test git-http-backend'
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-httpd.sh
+
+if ! test_have_prereq CURL; then
+       skip_all='skipping raw http-backend tests, curl not available'
+       test_done
+fi
+
 start_httpd
 
 GET() {
index 816e6923911cb6d594f3508e8540d680ecd983e9..db918752977b80940a7f8fd259c7ae9bc3c072e8 100644 (file)
@@ -1187,3 +1187,7 @@ test_lazy_prereq LONG_IS_64BIT '
 
 test_lazy_prereq TIME_IS_64BIT 'test-date is64bit'
 test_lazy_prereq TIME_T_IS_64BIT 'test-date time_t-is64bit'
+
+test_lazy_prereq CURL '
+       curl --version
+'