summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2010-08-19 16:08:09 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-08-31 19:12:01 (GMT)
commitaed604c7789146392bb4d4445717388c81c2701f (patch)
tree21fe3c8148e3e422938acedfc98de4a277754c8e
parent568899539d23be8689da4e7ee989deb8b8dc1a75 (diff)
downloadgit-aed604c7789146392bb4d4445717388c81c2701f.zip
git-aed604c7789146392bb4d4445717388c81c2701f.tar.gz
git-aed604c7789146392bb4d4445717388c81c2701f.tar.bz2
test-lib: Use $TEST_DIRECTORY or $GIT_BUILD_DIR instead of $(pwd) and ../
Change the redundant calls to $(pwd) to use $TEST_DIRECTORY instead. None of these were being executed after we cd'd somewhere else so they weren't actually needed. This also makes it easier to add support for overriding the test library location and run tests in a different directory than t/. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--t/test-lib.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 9746ca4..a87771c 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -793,14 +793,14 @@ else # normal case, use ../bin-wrappers only unless $with_dashes:
PATH="$TEST_DIRECTORY/..:$PATH"
fi
fi
-GIT_BUILD_DIR=$(pwd)/..
-GIT_TEMPLATE_DIR=$(pwd)/../templates/blt
+GIT_BUILD_DIR="$TEST_DIRECTORY"/..
+GIT_TEMPLATE_DIR="$TEST_DIRECTORY"/../templates/blt
unset GIT_CONFIG
GIT_CONFIG_NOSYSTEM=1
GIT_CONFIG_NOGLOBAL=1
export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL
-. ../GIT-BUILD-OPTIONS
+. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
if test -z "$GIT_TEST_CMP"
then
@@ -812,22 +812,22 @@ then
fi
fi
-GITPERLLIB=$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git
+GITPERLLIB="$TEST_DIRECTORY"/../perl/blib/lib:"$TEST_DIRECTORY"/../perl/blib/arch/auto/Git
export GITPERLLIB
-test -d ../templates/blt || {
+test -d "$TEST_DIRECTORY"/../templates/blt || {
error "You haven't built things yet, have you?"
}
if test -z "$GIT_TEST_INSTALLED" && test -z "$NO_PYTHON"
then
- GITPYTHONLIB="$(pwd)/../git_remote_helpers/build/lib"
+ GITPYTHONLIB="$TEST_DIRECTORY/../git_remote_helpers/build/lib"
export GITPYTHONLIB
- test -d ../git_remote_helpers/build || {
+ test -d "$TEST_DIRECTORY"/../git_remote_helpers/build || {
error "You haven't built git_remote_helpers yet, have you?"
}
fi
-if ! test -x ../test-chmtime; then
+if ! test -x "$TEST_DIRECTORY"/../test-chmtime; then
echo >&2 'You need to build test-chmtime:'
echo >&2 'Run "make test-chmtime" in the source (toplevel) directory'
exit 1