Merge branch 'rj/test-ulimit-on-windows' into next
authorJunio C Hamano <gitster@pobox.com>
Sun, 24 Sep 2017 10:39:41 +0000 (19:39 +0900)
committerJunio C Hamano <gitster@pobox.com>
Sun, 24 Sep 2017 10:39:41 +0000 (19:39 +0900)
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

1  2 
t/t6120-describe.sh
t/test-lib.sh
diff --combined t/t6120-describe.sh
index 1e66f33b5dc74a42b443f53b64f494138b4ceb13,3d45dc2955015f4148dee1d7a8f15d1e8fd7d2fa..70d92d24cbdc840ab7d7f89a599777d021c34e07
@@@ -182,14 -182,10 +182,14 @@@ check_describe "test2-lightweight-*" --
  
  check_describe "test2-lightweight-*" --long --tags --match="test2-*" HEAD^
  
 -check_describe "test1-lightweight-*" --long --tags --match="test1-*" --match="test2-*" HEAD^
 +check_describe "test2-lightweight-*" --long --tags --match="test1-*" --match="test2-*" HEAD^
  
  check_describe "test2-lightweight-*" --long --tags --match="test1-*" --no-match --match="test2-*" HEAD^
  
 +check_describe "test1-lightweight-*" --long --tags --match="test1-*" --match="test3-*" HEAD
 +
 +check_describe "test1-lightweight-*" --long --tags --match="test3-*" --match="test1-*" HEAD
 +
  test_expect_success 'name-rev with exact tags' '
        echo A >expect &&
        tag_object=$(git rev-parse refs/tags/A) &&
@@@ -283,7 -279,6 +283,6 @@@ test_expect_success 'describe ignoring 
        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
diff --combined t/test-lib.sh
index 83f5d3dd21bbb7cae8b41bf2404f97bb43979d2c,c730c0bc1399e4d6c4846a4fe8d4afce28f0b51d..9b61f16f7a8807ad96014d79f1d1b968397584bf
@@@ -44,11 -44,6 +44,11 @@@ GIT_BUILD_DIR="$TEST_DIRECTORY"/.
  : ${ASAN_OPTIONS=detect_leaks=0:abort_on_error=1}
  export ASAN_OPTIONS
  
 +# If LSAN is in effect we _do_ want leak checking, but we still
 +# want to abort so that we notice the problems.
 +: ${LSAN_OPTIONS=abort_on_error=1}
 +export LSAN_OPTIONS
 +
  ################################################################
  # It appears that people try to run tests without building...
  "$GIT_BUILD_DIR/git" >/dev/null
@@@ -279,7 -274,7 +279,7 @@@ the
        test -z "$verbose" && verbose_only="$valgrind_only"
  elif test -n "$valgrind"
  then
 -      verbose=t
 +      test -z "$verbose_log" && verbose=t
  fi
  
  if test -n "$color"
@@@ -1067,14 -1062,8 +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 -1159,19 +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 |