@@ -648,7 +648,7 @@ test_create_repo () {
648
648
repo=" $1 "
649
649
mkdir -p " $repo "
650
650
cd " $repo " || error " Cannot setup test environment"
651
- " $GIT_EXEC_PATH /git-init" " --template=$TEST_DIRECTORY /.. /templates/blt/" >&3 2>&4 ||
651
+ " $GIT_EXEC_PATH /git-init" " --template=$GIT_BUILD_DIR /templates/blt/" >&3 2>&4 ||
652
652
error " cannot run git init -- have you built things yet?"
653
653
mv .git/hooks .git/hooks-disabled
654
654
cd " $owd "
@@ -711,6 +711,8 @@ test_done () {
711
711
# Test the binaries we have just built. The tests are kept in
712
712
# t/ subdirectory and are run in 'trash directory' subdirectory.
713
713
TEST_DIRECTORY=$( pwd)
714
+ GIT_BUILD_DIR=" $TEST_DIRECTORY " /..
715
+
714
716
if test -n " $valgrind "
715
717
then
716
718
make_symlink () {
737
739
test -x " $1 " || return
738
740
739
741
base=$( basename " $1 " )
740
- symlink_target=$TEST_DIRECTORY /.. /$base
742
+ symlink_target=$GIT_BUILD_DIR /$base
741
743
# do not override scripts
742
744
if test -x " $symlink_target " &&
743
745
test ! -d " $symlink_target " &&
756
758
# override all git executables in TEST_DIRECTORY/..
757
759
GIT_VALGRIND=$TEST_DIRECTORY /valgrind
758
760
mkdir -p " $GIT_VALGRIND " /bin
759
- for file in $TEST_DIRECTORY /../ git* $TEST_DIRECTORY /.. /test-*
761
+ for file in $GIT_BUILD_DIR / git* $GIT_BUILD_DIR /test-*
760
762
do
761
763
make_valgrind_symlink $file
762
764
done
@@ -777,24 +779,23 @@ then
777
779
elif test -n " $GIT_TEST_INSTALLED " ; then
778
780
GIT_EXEC_PATH=$( $GIT_TEST_INSTALLED /git --exec-path) ||
779
781
error " Cannot run git from $GIT_TEST_INSTALLED ."
780
- PATH=$GIT_TEST_INSTALLED :$TEST_DIRECTORY /.. :$PATH
782
+ PATH=$GIT_TEST_INSTALLED :$GIT_BUILD_DIR :$PATH
781
783
GIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:- $GIT_EXEC_PATH }
782
784
else # normal case, use ../bin-wrappers only unless $with_dashes:
783
- git_bin_dir=" $TEST_DIRECTORY /.. /bin-wrappers"
785
+ git_bin_dir=" $GIT_BUILD_DIR /bin-wrappers"
784
786
if ! test -x " $git_bin_dir /git" ; then
785
787
if test -z " $with_dashes " ; then
786
788
say " $git_bin_dir /git is not executable; using GIT_EXEC_PATH"
787
789
fi
788
790
with_dashes=t
789
791
fi
790
792
PATH=" $git_bin_dir :$PATH "
791
- GIT_EXEC_PATH=$TEST_DIRECTORY /..
793
+ GIT_EXEC_PATH=$GIT_BUILD_DIR
792
794
if test -n " $with_dashes " ; then
793
- PATH=" $TEST_DIRECTORY /.. :$PATH "
795
+ PATH=" $GIT_BUILD_DIR :$PATH "
794
796
fi
795
797
fi
796
- GIT_BUILD_DIR=" $TEST_DIRECTORY " /..
797
- GIT_TEMPLATE_DIR=" $TEST_DIRECTORY " /../templates/blt
798
+ GIT_TEMPLATE_DIR=" $GIT_BUILD_DIR " /templates/blt
798
799
unset GIT_CONFIG
799
800
GIT_CONFIG_NOSYSTEM=1
800
801
GIT_CONFIG_NOGLOBAL=1
@@ -812,22 +813,22 @@ then
812
813
fi
813
814
fi
814
815
815
- GITPERLLIB=" $TEST_DIRECTORY " /../ perl/blib/lib:" $TEST_DIRECTORY " /.. /perl/blib/arch/auto/Git
816
+ GITPERLLIB=" $GIT_BUILD_DIR " / perl/blib/lib:" $GIT_BUILD_DIR " /perl/blib/arch/auto/Git
816
817
export GITPERLLIB
817
- test -d " $TEST_DIRECTORY " /.. /templates/blt || {
818
+ test -d " $GIT_BUILD_DIR " /templates/blt || {
818
819
error " You haven't built things yet, have you?"
819
820
}
820
821
821
822
if test -z " $GIT_TEST_INSTALLED " && test -z " $NO_PYTHON "
822
823
then
823
- GITPYTHONLIB=" $TEST_DIRECTORY /.. /git_remote_helpers/build/lib"
824
+ GITPYTHONLIB=" $GIT_BUILD_DIR /git_remote_helpers/build/lib"
824
825
export GITPYTHONLIB
825
- test -d " $TEST_DIRECTORY " /.. /git_remote_helpers/build || {
826
+ test -d " $GIT_BUILD_DIR " /git_remote_helpers/build || {
826
827
error " You haven't built git_remote_helpers yet, have you?"
827
828
}
828
829
fi
829
830
830
- if ! test -x " $TEST_DIRECTORY " /.. /test-chmtime; then
831
+ if ! test -x " $GIT_BUILD_DIR " /test-chmtime; then
831
832
echo >&2 ' You need to build test-chmtime:'
832
833
echo >&2 ' Run "make test-chmtime" in the source (toplevel) directory'
833
834
exit 1
0 commit comments