Merge branch 'rr/test-use-shell-path-not-shell' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 17 Oct 2012 17:27:28 +0000 (10:27 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 17 Oct 2012 17:27:28 +0000 (10:27 -0700)
* rr/test-use-shell-path-not-shell:
test-lib: use $SHELL_PATH, not $SHELL

1  2 
t/test-lib.sh
diff --combined t/test-lib.sh
index e823d86e415226680299fdd4ad487bd45b9d3bed,49d8b21d2d1eb301105f3aee2ff91f27344c12a2..b8ee3486b174caf656e620e2bc888c820d37d60d
  # You should have received a copy of the GNU General Public License
  # along with this program.  If not, see http://www.gnu.org/licenses/ .
  
- # if --tee was passed, write the output not only to the terminal, but
- # additionally to the file test-results/$BASENAME.out, too.
- case "$GIT_TEST_TEE_STARTED, $* " in
- done,*)
-       # do not redirect again
-       ;;
- *' --tee '*|*' --va'*)
-       mkdir -p test-results
-       BASE=test-results/$(basename "$0" .sh)
-       (GIT_TEST_TEE_STARTED=done ${SHELL-sh} "$0" "$@" 2>&1;
-        echo $? > $BASE.exit) | tee $BASE.out
-       test "$(cat $BASE.exit)" = 0
-       exit
-       ;;
- esac
  # Keep the original TERM for say_color
  ORIGINAL_TERM=$TERM
  
@@@ -51,18 -35,25 +35,34 @@@ the
  fi
  GIT_BUILD_DIR="$TEST_DIRECTORY"/..
  
 +################################################################
 +# It appears that people try to run tests without building...
 +"$GIT_BUILD_DIR/git" >/dev/null
 +if test $? != 1
 +then
 +      echo >&2 'error: you do not seem to have built git yet.'
 +      exit 1
 +fi
 +
  . "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
  export PERL_PATH SHELL_PATH
  
+ # if --tee was passed, write the output not only to the terminal, but
+ # additionally to the file test-results/$BASENAME.out, too.
+ case "$GIT_TEST_TEE_STARTED, $* " in
+ done,*)
+       # do not redirect again
+       ;;
+ *' --tee '*|*' --va'*)
+       mkdir -p test-results
+       BASE=test-results/$(basename "$0" .sh)
+       (GIT_TEST_TEE_STARTED=done ${SHELL_PATH} "$0" "$@" 2>&1;
+        echo $? > $BASE.exit) | tee $BASE.out
+       test "$(cat $BASE.exit)" = 0
+       exit
+       ;;
+ esac
  # For repeatability, reset the environment to known value.
  LANG=C
  LC_ALL=C
@@@ -668,29 -659,9 +668,29 @@@ test_i18ngrep () 
        fi
  }
  
 -# test whether the filesystem supports symbolic links
 -ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
 -rm -f y
 +test_lazy_prereq SYMLINKS '
 +      # test whether the filesystem supports symbolic links
 +      ln -s x y && test -h y
 +'
 +
 +test_lazy_prereq CASE_INSENSITIVE_FS '
 +      echo good >CamelCase &&
 +      echo bad >camelcase &&
 +      test "$(cat CamelCase)" != good
 +'
 +
 +test_lazy_prereq UTF8_NFD_TO_NFC '
 +      # check whether FS converts nfd unicode to nfc
 +      auml=$(printf "\303\244")
 +      aumlcdiar=$(printf "\141\314\210")
 +      >"$auml" &&
 +      case "$(echo *)" in
 +      "$aumlcdiar")
 +              true ;;
 +      *)
 +              false ;;
 +      esac
 +'
  
  # When the tests are run as root, permission tests will report that
  # things are writable when they shouldn't be.