From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH v2 1/4] test-lib: Use $TEST_DIRECTORY or $GIT_BUILD_DIR instead of $(pwd) and ../
Date: Thu, 19 Aug 2010 16:05:58 +0000 [thread overview]
Message-ID: <1282233961-27203-2-git-send-email-avarab@gmail.com> (raw)
In-Reply-To: <1282138473-15613-1-git-send-email-avarab@gmail.com>
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>
---
t/test-lib.sh | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 5bb7662..0e460f9 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -830,14 +830,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
@@ -849,22 +849,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
--
1.7.2.1.414.g9bf49
next prev parent reply other threads:[~2010-08-19 16:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-17 9:43 [PATCH] t/t0000-basic.sh: Don't run a passing TODO unless TEST_PASSING_TODO=1 Ævar Arnfjörð Bjarmason
2010-08-17 17:57 ` Sverre Rabbelier
2010-08-17 19:12 ` Junio C Hamano
2010-08-18 13:34 ` [PATCH v2 0/4] Support for running tests outside t/ + don't run a TODO test Ævar Arnfjörð Bjarmason
2010-08-19 16:05 ` Ævar Arnfjörð Bjarmason
2010-08-19 16:05 ` Ævar Arnfjörð Bjarmason [this message]
2010-08-19 16:05 ` [PATCH v2 2/4] test-lib: Use "$GIT_BUILD_DIR" instead of "$TEST_DIRECTORY"/../ Ævar Arnfjörð Bjarmason
2010-08-19 16:06 ` [PATCH v2 3/4] test-lib: Allow overriding of TEST_DIRECTORY Ævar Arnfjörð Bjarmason
2010-08-19 16:06 ` [PATCH v2 4/4] t/t0000-basic.sh: Run the passing TODO test inside its own test-lib Ævar Arnfjörð Bjarmason
2010-08-19 16:08 ` [PATCH v3 0/4] Support for running tests outside t/ + don't run a TODO test Ævar Arnfjörð Bjarmason
2010-08-19 16:18 ` Jeff King
2010-08-19 16:08 ` [PATCH v3 1/4] test-lib: Use $TEST_DIRECTORY or $GIT_BUILD_DIR instead of $(pwd) and ../ Ævar Arnfjörð Bjarmason
2010-08-19 16:08 ` [PATCH v3 2/4] test-lib: Use "$GIT_BUILD_DIR" instead of "$TEST_DIRECTORY"/../ Ævar Arnfjörð Bjarmason
2010-08-19 16:08 ` [PATCH v3 3/4] test-lib: Allow overriding of TEST_DIRECTORY Ævar Arnfjörð Bjarmason
2010-08-19 16:08 ` [PATCH v3 4/4] t/t0000-basic.sh: Run the passing TODO test inside its own test-lib Ævar Arnfjörð Bjarmason
2010-08-18 13:34 ` [PATCH v2 1/4] test-lib: Use $TEST_DIRECTORY or $GIT_BUILD_DIR instead of $(pwd) and ../ Ævar Arnfjörð Bjarmason
2010-08-18 13:34 ` [PATCH v2 2/4] test-lib: Use "$GIT_BUILD_DIR" instead of "$TEST_DIRECTORY"/../ Ævar Arnfjörð Bjarmason
2010-08-18 13:34 ` [PATCH v2 3/4] test-lib: Allow overriding of TEST_DIRECTORY Ævar Arnfjörð Bjarmason
2010-08-18 13:34 ` [PATCH v2 4/4] t/t0000-basic.sh: Run the passing TODO test inside its own test-lib Ævar Arnfjörð Bjarmason
2010-08-19 17:39 ` Sverre Rabbelier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1282233961-27203-2-git-send-email-avarab@gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).