From: Junio C Hamano Date: Fri, 15 Jul 2016 16:43:42 +0000 (-0700) Subject: Merge branch 'jk/tzoffset-fix' into maint X-Git-Tag: v2.9.2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/33eacd3ff43e49109594c44e93b7ee66725fb8af?hp=-c Merge branch 'jk/tzoffset-fix' into maint Skip tests that are unrunnable on platforms without 64-bit long to avoid unnecessary test failures. * jk/tzoffset-fix: t0006: skip "far in the future" test when unsigned long is not long enough --- 33eacd3ff43e49109594c44e93b7ee66725fb8af diff --combined t/test-lib.sh index 0055ebba46,4595734f95..11201e9cf8 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@@ -202,13 -202,13 +202,13 @@@ d } run_list=$1; shift ;; --run=*) - run_list=$(expr "z$1" : 'z[^=]*=\(.*\)'); shift ;; + run_list=${1#--*=}; shift ;; -h|--h|--he|--hel|--help) help=t; shift ;; -v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose) verbose=t; shift ;; --verbose-only=*) - verbose_only=$(expr "z$1" : 'z[^=]*=\(.*\)') + verbose_only=${1#--*=} shift ;; -q|--q|--qu|--qui|--quie|--quiet) # Ignore --quiet under a TAP::Harness. Saying how many tests @@@ -222,15 -222,15 +222,15 @@@ valgrind=memcheck shift ;; --valgrind=*) - valgrind=$(expr "z$1" : 'z[^=]*=\(.*\)') + valgrind=${1#--*=} shift ;; --valgrind-only=*) - valgrind_only=$(expr "z$1" : 'z[^=]*=\(.*\)') + valgrind_only=${1#--*=} shift ;; --tee) shift ;; # was handled already --root=*) - root=$(expr "z$1" : 'z[^=]*=\(.*\)') + root=${1#--*=} shift ;; --chain-lint) GIT_TEST_CHAIN_LINT=1 @@@ -322,19 -322,6 +322,19 @@@ els exec 4>/dev/null 3>/dev/null fi +# Send any "-x" output directly to stderr to avoid polluting tests +# which capture stderr. We can do this unconditionally since it +# has no effect if tracing isn't turned on. +# +# Note that this sets up the trace fd as soon as we assign the variable, so it +# must come after the creation of descriptor 4 above. Likewise, we must never +# unset this, as it has the side effect of closing descriptor 4, which we +# use to show verbose tests to the user. +# +# Note also that we don't need or want to export it. The tracing is local to +# this shell, and we would not want to influence any shells we exec. +BASH_XTRACEFD=4 + test_failure=0 test_count=0 test_fixed=0 @@@ -867,10 -854,10 +867,10 @@@ test -d "$GIT_BUILD_DIR"/templates/blt error "You haven't built things yet, have you?" } -if ! test -x "$GIT_BUILD_DIR"/test-chmtime +if ! test -x "$GIT_BUILD_DIR"/t/helper/test-chmtime then echo >&2 'You need to build test-chmtime:' - echo >&2 'Run "make test-chmtime" in the source (toplevel) directory' + echo >&2 'Run "make t/helper/test-chmtime" in the source (toplevel) directory' exit 1 fi @@@ -1013,7 -1000,7 +1013,7 @@@ test_i18ngrep () test_lazy_prereq PIPE ' # test whether the filesystem supports FIFOs case $(uname -s) in - CYGWIN*) + CYGWIN*|MINGW*) false ;; *) @@@ -1111,3 -1098,12 +1111,12 @@@ run_with_limited_cmdline () } test_lazy_prereq CMDLINE_LIMIT 'run_with_limited_cmdline true' + + build_option () { + git version --build-options | + sed -ne "s/^$1: //p" + } + + test_lazy_prereq LONG_IS_64BIT ' + test 8 -le "$(build_option sizeof-long)" + '