From 21dac1deee58df80f7b2cd17d661864c8db5d28a Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Thu, 14 Sep 2017 18:24:41 +0100 Subject: test-lib: don't use ulimit in test prerequisites on cygwin On cygwin (and MinGW), the 'ulimit' built-in bash command does not have the desired effect of limiting the resources of new processes, at least for the stack and file descriptors. However, it always returns success and leads to several test prerequisites being erroneously set to true. Add a check for cygwin and MinGW to the prerequisite expressions, using a 'test_have_prereq !MINGW,!CYGWIN' clause, to guard against using ulimit. This affects the prerequisite expressions for the ULIMIT_STACK_SIZE, CMDLINE_LIMIT and ULIMIT_FILE_DESCRIPTORS prerequisites. Signed-off-by: Ramsay Jones Reviewed-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- t/test-lib.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 't/test-lib.sh') diff --git a/t/test-lib.sh b/t/test-lib.sh index f22c1b260a..8a91fb10a9 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1165,13 +1165,19 @@ run_with_limited_cmdline () { (ulimit -s 128 && "$@") } -test_lazy_prereq CMDLINE_LIMIT 'run_with_limited_cmdline true' +test_lazy_prereq CMDLINE_LIMIT ' + test_have_prereq !MINGW,!CYGWIN && + run_with_limited_cmdline true +' run_with_limited_stack () { (ulimit -s 128 && "$@") } -test_lazy_prereq ULIMIT_STACK_SIZE 'run_with_limited_stack true' +test_lazy_prereq ULIMIT_STACK_SIZE ' + test_have_prereq !MINGW,!CYGWIN && + run_with_limited_stack true +' build_option () { git version --build-options | -- cgit v1.3-5-g9baa