Thread (30 messages) flat view 30 messages, 2 authors, 2021-09-21
STALE1827d

Revision v2 of 2 in this series.

Revisions (2)
  1. v2 current
  2. v3 [diff vs current]

[PATCH v2 1/6] test-lib.sh: add a UNIX_SOCKETS prerequisite

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-09-10 15:38:48
Subsystem: the rest · Maintainer: Linus Torvalds

Instead of checking $NO_UNIX_SOCKETS directly in
t/t0301-credential-cache.sh, follow the more common pattern of
creating a test prerequisite in test-lib.sh.

See 6320358e31d (Makefile: unix sockets may not available on some
platforms, 2011-12-12) for the original implementation of
NO_UNIX_SOCKETS.

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 t/t0301-credential-cache.sh | 5 +++--
 t/test-lib.sh               | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/t/t0301-credential-cache.sh b/t/t0301-credential-cache.sh
index ebd5fa5249c..002de427984 100755
--- a/t/t0301-credential-cache.sh
+++ b/t/t0301-credential-cache.sh
@@ -4,10 +4,11 @@ test_description='credential-cache tests'
 . ./test-lib.sh
 . "$TEST_DIRECTORY"/lib-credential.sh
 
-test -z "$NO_UNIX_SOCKETS" || {
+if ! test_have_prereq UNIX_SOCKETS
+then
 	skip_all='skipping credential-cache tests, unix sockets not available'
 	test_done
-}
+fi
 
 # don't leave a stale daemon running
 test_atexit 'git credential-cache exit'
diff --git a/t/test-lib.sh b/t/test-lib.sh
index abcfbed6d61..583f266b1e8 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1533,6 +1533,7 @@ test -z "$NO_PYTHON" && test_set_prereq PYTHON
 test -n "$USE_LIBPCRE2" && test_set_prereq PCRE
 test -n "$USE_LIBPCRE2" && test_set_prereq LIBPCRE2
 test -z "$NO_GETTEXT" && test_set_prereq GETTEXT
+test -z "$NO_UNIX_SOCKETS" && test_set_prereq UNIX_SOCKETS
 
 if test -z "$GIT_TEST_CHECK_CACHE_TREE"
 then
-- 
2.33.0.876.g423ac861752
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help