Skip to content

Commit b30fdb4

Browse files
ttaylorrgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a2d57e2 commit b30fdb4

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

t/t1400-update-ref.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,15 +1342,6 @@ test_expect_success 'fails with duplicate ref update via symref' '
13421342
test_cmp expect actual
13431343
'
13441344

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-
13541345
test_expect_success ULIMIT_FILE_DESCRIPTORS 'large transaction creating branches does not burst open file limit' '
13551346
(
13561347
for i in $(test_seq 33)

t/test-lib.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,15 @@ test_lazy_prereq ULIMIT_STACK_SIZE '
16181618
run_with_limited_stack true
16191619
'
16201620

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+
16211630
build_option () {
16221631
git version --build-options |
16231632
sed -ne "s/^$1: //p"

0 commit comments

Comments
 (0)