3434# Keep the original TERM for say_color
3535ORIGINAL_TERM=$TERM
3636
37+ # Test the binaries we have just built. The tests are kept in
38+ # t/ subdirectory and are run in 'trash directory' subdirectory.
39+ if test -z " $TEST_DIRECTORY "
40+ then
41+ # We allow tests to override this, in case they want to run tests
42+ # outside of t/, e.g. for running tests on the test library
43+ # itself.
44+ TEST_DIRECTORY=$( pwd)
45+ fi
46+ if test -z " $TEST_OUTPUT_DIRECTORY "
47+ then
48+ # Similarly, override this to store the test-results subdir
49+ # elsewhere
50+ TEST_OUTPUT_DIRECTORY=$TEST_DIRECTORY
51+ fi
52+ GIT_BUILD_DIR=" $TEST_DIRECTORY " /..
53+
54+ . " $GIT_BUILD_DIR " /GIT-BUILD-OPTIONS
55+ export PERL_PATH SHELL_PATH
56+
3757# For repeatability, reset the environment to known value.
3858LANG=C
3959LC_ALL=C
@@ -46,7 +66,7 @@ EDITOR=:
4666# /usr/xpg4/bin/sh and /bin/ksh to bail out. So keep the unsets
4767# deriving from the command substitution clustered with the other
4868# ones.
49- unset VISUAL EMAIL LANGUAGE COLUMNS $( perl -e '
69+ unset VISUAL EMAIL LANGUAGE COLUMNS $( " $PERL_PATH " -e '
5070 my @env = keys %ENV;
5171 my $ok = join("|", qw(
5272 TRACE
@@ -230,7 +250,7 @@ trap 'die' EXIT
230250
231251# The user-facing functions are loaded from a separate file so that
232252# test_perf subshells can have them too
233- . " ${ TEST_DIRECTORY:- .} " /test-lib-functions.sh
253+ . " $TEST_DIRECTORY /test-lib-functions.sh"
234254
235255# You are not expected to call test_ok_ and test_failure_ directly, use
236256# the text_expect_* functions instead.
@@ -381,23 +401,6 @@ test_done () {
381401 esac
382402}
383403
384- # Test the binaries we have just built. The tests are kept in
385- # t/ subdirectory and are run in 'trash directory' subdirectory.
386- if test -z " $TEST_DIRECTORY "
387- then
388- # We allow tests to override this, in case they want to run tests
389- # outside of t/, e.g. for running tests on the test library
390- # itself.
391- TEST_DIRECTORY=$( pwd)
392- fi
393- if test -z " $TEST_OUTPUT_DIRECTORY "
394- then
395- # Similarly, override this to store the test-results subdir
396- # elsewhere
397- TEST_OUTPUT_DIRECTORY=$TEST_DIRECTORY
398- fi
399- GIT_BUILD_DIR=" $TEST_DIRECTORY " /..
400-
401404if test -n " $valgrind "
402405then
403406 make_symlink () {
@@ -493,10 +496,6 @@ GIT_CONFIG_NOSYSTEM=1
493496GIT_ATTR_NOSYSTEM=1
494497export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_ATTR_NOSYSTEM
495498
496- . " $GIT_BUILD_DIR " /GIT-BUILD-OPTIONS
497-
498- export PERL_PATH
499-
500499if test -z " $GIT_TEST_CMP "
501500then
502501 if test -n " $GIT_TEST_CMP_USE_COPIED_CONTEXT "
0 commit comments