Merge branch 'rj/test-ulimit-on-windows'

On Cygwin, "ulimit -s" does not report failure but it does not work
at all, which causes an unexpected success of some tests that
expect failures under a limited stack situation.  This has been
fixed.

* rj/test-ulimit-on-windows:
  t9010-*.sh: skip all tests if the PIPE prereq is missing
  test-lib: use more compact expression in PIPE prerequisite
  test-lib: don't use ulimit in test prerequisites on cygwin
This commit is contained in:
Junio C Hamano 2017-09-25 15:24:09 +09:00
commit 9709ffac80
5 changed files with 42 additions and 40 deletions

View file

@ -1253,7 +1253,10 @@ run_with_limited_open_files () {
(ulimit -n 32 && "$@")
}
test_lazy_prereq ULIMIT_FILE_DESCRIPTORS 'run_with_limited_open_files true'
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' '
(

View file

@ -279,7 +279,6 @@ test_expect_success 'describe ignoring a borken submodule' '
grep broken out
'
# we require ulimit, this excludes Windows
test_expect_failure ULIMIT_STACK_SIZE 'name-rev works in a deep repo' '
i=1 &&
while test $i -lt 8000

View file

@ -1863,7 +1863,6 @@ test_expect_success 'version sort with very long prerelease suffix' '
git tag -l --sort=version:refname
'
# we require ulimit, this excludes Windows
test_expect_success ULIMIT_STACK_SIZE '--contains and --no-contains work in a deep repo' '
>expect &&
i=1 &&

View file

@ -4,12 +4,13 @@ test_description='check svn dumpfile importer'
. ./test-lib.sh
if test_have_prereq !PIPE
then
skip_all="svn dumpfile importer testing requires the PIPE prerequisite"
test_done
fi
reinit_git () {
if ! test_declared_prereq PIPE
then
echo >&4 "reinit_git: need to declare PIPE prerequisite"
return 127
fi
rm -fr .git &&
rm -f stream backflow &&
git init &&
@ -54,19 +55,19 @@ text_no_props () {
>empty
test_expect_success PIPE 'empty dump' '
test_expect_success 'empty dump' '
reinit_git &&
echo "SVN-fs-dump-format-version: 2" >input &&
try_dump input
'
test_expect_success PIPE 'v4 dumps not supported' '
test_expect_success 'v4 dumps not supported' '
reinit_git &&
echo "SVN-fs-dump-format-version: 4" >v4.dump &&
try_dump v4.dump must_fail
'
test_expect_failure PIPE 'empty revision' '
test_expect_failure 'empty revision' '
reinit_git &&
printf "rev <nobody, nobody@local>: %s\n" "" "" >expect &&
cat >emptyrev.dump <<-\EOF &&
@ -86,7 +87,7 @@ test_expect_failure PIPE 'empty revision' '
test_cmp expect actual
'
test_expect_success PIPE 'empty properties' '
test_expect_success 'empty properties' '
reinit_git &&
printf "rev <nobody, nobody@local>: %s\n" "" "" >expect &&
cat >emptyprop.dump <<-\EOF &&
@ -109,7 +110,7 @@ test_expect_success PIPE 'empty properties' '
test_cmp expect actual
'
test_expect_success PIPE 'author name and commit message' '
test_expect_success 'author name and commit message' '
reinit_git &&
echo "<author@example.com, author@example.com@local>" >expect.author &&
cat >message <<-\EOF &&
@ -143,7 +144,7 @@ test_expect_success PIPE 'author name and commit message' '
test_cmp expect.author actual.author
'
test_expect_success PIPE 'unsupported properties are ignored' '
test_expect_success 'unsupported properties are ignored' '
reinit_git &&
echo author >expect &&
cat >extraprop.dump <<-\EOF &&
@ -168,7 +169,7 @@ test_expect_success PIPE 'unsupported properties are ignored' '
test_cmp expect actual
'
test_expect_failure PIPE 'timestamp and empty file' '
test_expect_failure 'timestamp and empty file' '
echo author@example.com >expect.author &&
echo 1999-01-01 >expect.date &&
echo file >expect.files &&
@ -210,7 +211,7 @@ test_expect_failure PIPE 'timestamp and empty file' '
test_cmp empty file
'
test_expect_success PIPE 'directory with files' '
test_expect_success 'directory with files' '
reinit_git &&
printf "%s\n" directory/file1 directory/file2 >expect.files &&
echo hi >hi &&
@ -263,7 +264,7 @@ test_expect_success PIPE 'directory with files' '
test_cmp hi directory/file2
'
test_expect_success PIPE 'branch name with backslash' '
test_expect_success 'branch name with backslash' '
reinit_git &&
sort <<-\EOF >expect.branch-files &&
trunk/file1
@ -362,7 +363,7 @@ test_expect_success PIPE 'branch name with backslash' '
test_cmp expect.branch-files actual.branch-files
'
test_expect_success PIPE 'node without action' '
test_expect_success 'node without action' '
reinit_git &&
cat >inaction.dump <<-\EOF &&
SVN-fs-dump-format-version: 3
@ -383,7 +384,7 @@ test_expect_success PIPE 'node without action' '
try_dump inaction.dump must_fail
'
test_expect_success PIPE 'action: add node without text' '
test_expect_success 'action: add node without text' '
reinit_git &&
cat >textless.dump <<-\EOF &&
SVN-fs-dump-format-version: 3
@ -405,7 +406,7 @@ test_expect_success PIPE 'action: add node without text' '
try_dump textless.dump must_fail
'
test_expect_failure PIPE 'change file mode but keep old content' '
test_expect_failure 'change file mode but keep old content' '
reinit_git &&
cat >expect <<-\EOF &&
OBJID
@ -481,7 +482,7 @@ test_expect_failure PIPE 'change file mode but keep old content' '
test_cmp hello actual.target
'
test_expect_success PIPE 'NUL in property value' '
test_expect_success 'NUL in property value' '
reinit_git &&
echo "commit message" >expect.message &&
{
@ -507,7 +508,7 @@ test_expect_success PIPE 'NUL in property value' '
test_cmp expect.message actual.message
'
test_expect_success PIPE 'NUL in log message, file content, and property name' '
test_expect_success 'NUL in log message, file content, and property name' '
# Caveat: svnadmin 1.6.16 (r1073529) truncates at \0 in the
# svn:specialQnotreally example.
reinit_git &&
@ -587,7 +588,7 @@ test_expect_success PIPE 'NUL in log message, file content, and property name' '
test_cmp expect.hello2 actual.hello2
'
test_expect_success PIPE 'change file mode and reiterate content' '
test_expect_success 'change file mode and reiterate content' '
reinit_git &&
cat >expect <<-\EOF &&
OBJID
@ -667,7 +668,7 @@ test_expect_success PIPE 'change file mode and reiterate content' '
test_cmp hello actual.target
'
test_expect_success PIPE 'deltas supported' '
test_expect_success 'deltas supported' '
reinit_git &&
{
# (old) h + (inline) ello + (old) \n
@ -731,7 +732,7 @@ test_expect_success PIPE 'deltas supported' '
try_dump delta.dump
'
test_expect_success PIPE 'property deltas supported' '
test_expect_success 'property deltas supported' '
reinit_git &&
cat >expect <<-\EOF &&
OBJID
@ -796,7 +797,7 @@ test_expect_success PIPE 'property deltas supported' '
test_cmp expect actual
'
test_expect_success PIPE 'properties on /' '
test_expect_success 'properties on /' '
reinit_git &&
cat <<-\EOF >expect &&
OBJID
@ -850,7 +851,7 @@ test_expect_success PIPE 'properties on /' '
test_cmp expect actual
'
test_expect_success PIPE 'deltas for typechange' '
test_expect_success 'deltas for typechange' '
reinit_git &&
cat >expect <<-\EOF &&
OBJID
@ -935,7 +936,7 @@ test_expect_success PIPE 'deltas for typechange' '
test_cmp expect actual
'
test_expect_success PIPE 'deltas need not consume the whole preimage' '
test_expect_success 'deltas need not consume the whole preimage' '
reinit_git &&
cat >expect <<-\EOF &&
OBJID
@ -1040,7 +1041,7 @@ test_expect_success PIPE 'deltas need not consume the whole preimage' '
test_cmp expect.3 actual.3
'
test_expect_success PIPE 'no hang for delta trying to read past end of preimage' '
test_expect_success 'no hang for delta trying to read past end of preimage' '
reinit_git &&
{
# COPY 1
@ -1087,7 +1088,7 @@ test_expect_success 'set up svn repo' '
fi
'
test_expect_success SVNREPO,PIPE 't9135/svn.dump' '
test_expect_success SVNREPO 't9135/svn.dump' '
mkdir -p simple-git &&
(
cd simple-git &&

View file

@ -1067,14 +1067,8 @@ test_i18ngrep () {
test_lazy_prereq PIPE '
# test whether the filesystem supports FIFOs
case $(uname -s) in
CYGWIN*|MINGW*)
false
;;
*)
rm -f testfifo && mkfifo testfifo
;;
esac
test_have_prereq !MINGW,!CYGWIN &&
rm -f testfifo && mkfifo testfifo
'
test_lazy_prereq SYMLINKS '
@ -1170,13 +1164,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 |