]> asedeno.scripts.mit.edu Git - git.git/blobdiff - t/test-lib.sh
Merge branch 'jc/maint-read-tree-multi'
[git.git] / t / test-lib.sh
index b4b626e83774519fc4560239231756ca22df43fe..dad1437fa49596cf6f36b40b1ab18b008620a246 100644 (file)
@@ -491,7 +491,7 @@ test_create_repo () {
        repo="$1"
        mkdir -p "$repo"
        cd "$repo" || error "Cannot setup test environment"
-       "$GIT_EXEC_PATH/git" init "--template=$owd/../templates/blt/" >&3 2>&4 ||
+       "$GIT_EXEC_PATH/git-init" "--template=$TEST_DIRECTORY/../templates/blt/" >&3 2>&4 ||
        error "cannot run git init -- have you built things yet?"
        mv .git/hooks .git/hooks-disabled
        cd "$owd"
@@ -523,14 +523,6 @@ test_done () {
        fi
        case "$test_failure" in
        0)
-               # We could:
-               # cd .. && rm -fr 'trash directory'
-               # but that means we forbid any tests that use their own
-               # subdirectory from calling test_done without coming back
-               # to where they started from.
-               # The Makefile provided will clean this test area so
-               # we will leave things as they are.
-
                say_color pass "passed all $msg"
 
                test -d "$remove_trash" &&
@@ -551,8 +543,16 @@ test_done () {
 TEST_DIRECTORY=$(pwd)
 if test -z "$valgrind"
 then
-       PATH=$TEST_DIRECTORY/..:$PATH
-       GIT_EXEC_PATH=$TEST_DIRECTORY/..
+       if test -z "$GIT_TEST_INSTALLED"
+       then
+               PATH=$TEST_DIRECTORY/..:$PATH
+               GIT_EXEC_PATH=$TEST_DIRECTORY/..
+       else
+               GIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path)  ||
+               error "Cannot run git from $GIT_TEST_INSTALLED."
+               PATH=$GIT_TEST_INSTALLED:$TEST_DIRECTORY/..:$PATH
+               GIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH}
+       fi
 else
        make_symlink () {
                test -h "$2" &&
@@ -689,13 +689,17 @@ case $(uname -s) in
        }
        # no POSIX permissions
        # backslashes in pathspec are converted to '/'
+       # exec does not inherit the PID
        ;;
 *)
        test_set_prereq POSIXPERM
        test_set_prereq BSLASHPSPEC
+       test_set_prereq EXECKEEPSPID
        ;;
 esac
 
+test -z "$NO_PERL" && test_set_prereq PERL
+
 # 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