@matheusbsbs / matheus-bagliano / commits / b30fdb4b4e
Fork 0

t/test-lib.sh: make ULIMIT_FILE_DESCRIPTORS available to tests

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>

Taylor Blau committed Apr 23, 2020 at 15:41 UTC b30fdb4b4e6608ccafdfa4a13893940b85a8a7e8
2 files changed +9 -9
t/t1400-update-ref.sh
-9
@@ -1342,15 +1342,6 @@ test_expect_success 'fails with duplicate ref update via symref' '
1342 test_cmp expect actual
1343 '
1344
1345 -run_with_limited_open_files () {
1346 - (ulimit -n 32 && "$@")
1347 -}
1348 -
1349 -test_lazy_prereq ULIMIT_FILE_DESCRIPTORS '
1350 - test_have_prereq !MINGW,!CYGWIN &&
1351 - run_with_limited_open_files true
1352 -'
1353 -
1345 test_expect_success ULIMIT_FILE_DESCRIPTORS 'large transaction creating branches does not burst open file limit' '
1346 (
1347 for i in $(test_seq 33)
t/test-lib.sh
+9
@@ -1618,6 +1618,15 @@ test_lazy_prereq ULIMIT_STACK_SIZE '
1618 run_with_limited_stack true
1619 '
1620
1621 +run_with_limited_open_files () {
1622 + (ulimit -n 32 && "$@")
1623 +}
1624 +
1625 +test_lazy_prereq ULIMIT_FILE_DESCRIPTORS '
1626 + test_have_prereq !MINGW,!CYGWIN &&
1627 + run_with_limited_open_files true
1628 +'
1629 +
1630 build_option () {
1631 git version --build-options |
1632 sed -ne "s/^$1: //p"