Skip to content

Commit e9184b0

Browse files
peffgitster
authored andcommitted
t5561: skip tests if curl is not available
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 <[email protected]> Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fcd9d70 commit e9184b0

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

t/t5561-http-backend.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
test_description='test git-http-backend'
44
. ./test-lib.sh
55
. "$TEST_DIRECTORY"/lib-httpd.sh
6+
7+
if ! test_have_prereq CURL; then
8+
skip_all='skipping raw http-backend tests, curl not available'
9+
test_done
10+
fi
11+
612
start_httpd
713

814
GET() {

t/test-lib.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,3 +1187,7 @@ test_lazy_prereq LONG_IS_64BIT '
11871187

11881188
test_lazy_prereq TIME_IS_64BIT 'test-date is64bit'
11891189
test_lazy_prereq TIME_T_IS_64BIT 'test-date time_t-is64bit'
1190+
1191+
test_lazy_prereq CURL '
1192+
curl --version
1193+
'

0 commit comments

Comments
 (0)