]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/test-lib.sh: make ULIMIT_FILE_DESCRIPTORS available to tests
authorTaylor Blau <me@ttaylorr.com>
Thu, 23 Apr 2020 21:41:06 +0000 (15:41 -0600)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Apr 2020 21:58:52 +0000 (14:58 -0700)
In t1400 the prerequisite 'ULIMIT_FILE_DESCRIPTORS' is defined and used
to effectively guard the helper function 'run_with_limited_open_files'
from being used on systems that do not satisfy this prerequisite.

In the subsequent patch, we will introduce another test outside of t1400
that would benefit from using this prerequisite. So, move it to
'test-lib.sh' instead so that it can be used by multiple tests.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1400-update-ref.sh
t/test-lib.sh

index b815cdd1b88052bdf98a0b371a25290461e58e02..65574e0f1ccedee858277d8da0dff980d62a484d 100755 (executable)
@@ -1342,15 +1342,6 @@ test_expect_success 'fails with duplicate ref update via symref' '
        test_cmp expect actual
 '
 
-run_with_limited_open_files () {
-       (ulimit -n 32 && "$@")
-}
-
-test_lazy_prereq ULIMIT_FILE_DESCRIPTORS '
-       test_have_prereq !MINGW,!CYGWIN &&
-       run_with_limited_open_files true
-'
-
 test_expect_success ULIMIT_FILE_DESCRIPTORS 'large transaction creating branches does not burst open file limit' '
 (
        for i in $(test_seq 33)
index 44df51be8fb10fca0d76decccf5adbdd6568ae06..cb0f93eb580f59e5a4459ae62a149a614b06f690 100644 (file)
@@ -1618,6 +1618,15 @@ test_lazy_prereq ULIMIT_STACK_SIZE '
        run_with_limited_stack true
 '
 
+run_with_limited_open_files () {
+       (ulimit -n 32 && "$@")
+}
+
+test_lazy_prereq ULIMIT_FILE_DESCRIPTORS '
+       test_have_prereq !MINGW,!CYGWIN &&
+       run_with_limited_open_files true
+'
+
 build_option () {
        git version --build-options |
        sed -ne "s/^$1: //p"