Merge branch 'jk/maint-do-not-feed-stdin-to-tests'
authorJunio C Hamano <gitster@pobox.com>
Thu, 22 Dec 2011 19:27:25 +0000 (11:27 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 22 Dec 2011 19:27:25 +0000 (11:27 -0800)
* jk/maint-do-not-feed-stdin-to-tests:
test-lib: redirect stdin of tests

1  2 
t/test-lib.sh
diff --combined t/test-lib.sh
index 0e932dd9758f71cbc95c6ab20f7c11e9056d7826,a73a77b3b62ee52127d97484899c6f3c18a68245..a65dfc7ea93b3ec95e6ab7cd5b758029fe599d22
@@@ -44,7 -44,6 +44,7 @@@ export LANG LC_ALL PAGER TERM T
  EDITOR=:
  unset VISUAL
  unset EMAIL
 +unset LANGUAGE
  unset $(perl -e '
        my @env = keys %ENV;
        my $ok = join("|", qw(
@@@ -192,6 -191,7 +192,7 @@@ the
  fi
  
  exec 5>&1
+ exec 6<&0
  if test "$verbose" = "t"
  then
        exec 4>&2 3>&1
@@@ -380,11 -380,6 +381,11 @@@ test_config () 
        git config "$@"
  }
  
 +test_config_global () {
 +      test_when_finished "test_unconfig --global '$1'" &&
 +      git config --global "$@"
 +}
 +
  # Use test_set_prereq to tell that a particular prerequisite is available.
  # The prerequisite can later be checked for in two ways:
  #
@@@ -475,7 -470,7 +476,7 @@@ test_debug () 
  test_eval_ () {
        # This is a separate function because some tests use
        # "return" to end a test_expect_success block early.
-       eval >&3 2>&4 "$*"
+       eval </dev/null >&3 2>&4 "$*"
  }
  
  test_run_ () {
@@@ -956,8 -951,6 +957,8 @@@ the
        do
                make_valgrind_symlink $file
        done
 +      # special-case the mergetools loadables
 +      make_symlink "$GIT_BUILD_DIR"/mergetools "$GIT_VALGRIND/bin/mergetools"
        OLDIFS=$IFS
        IFS=:
        for path in $PATH
  test -z "$NO_PERL" && test_set_prereq PERL
  test -z "$NO_PYTHON" && test_set_prereq PYTHON
  test -n "$USE_LIBPCRE" && test_set_prereq LIBPCRE
 +test -z "$NO_GETTEXT" && test_set_prereq GETTEXT
  
  # Can we rely on git's output in the C locale?
  if test -n "$GETTEXT_POISON"
  then
        GIT_GETTEXT_POISON=YesPlease
        export GIT_GETTEXT_POISON
 +      test_set_prereq GETTEXT_POISON
  else
        test_set_prereq C_LOCALE_OUTPUT
  fi