From: "Santi Béjar" <sbejar@gmail.com>
To: git@vger.kernel.org
Cc: "Santi Béjar" <sbejar@gmail.com>
Subject: [PATCH] test-lib: Allow to be used by contrib projects
Date: Thu, 12 Jun 2008 21:13:52 +0200 [thread overview]
Message-ID: <1213298033-6086-1-git-send-email-sbejar@gmail.com> (raw)
The contrib project can have test scripts like the ones in git.git.
They only need a test-lib.sh and a Makefile like the following:
[test-lib.sh]
GIT_TEST_DIR=$(pwd)/../../../t
PATH=$(pwd)/..:$PATH
. ../../../t/test-lib.sh
[end of test-lib.sh]
[Makefile]
include ../../../t/Makefile
Signed-off-by: Santi Béjar <sbejar@gmail.com>
---
t/test-lib.sh | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 7a8bd27..62976da 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -387,28 +387,29 @@ test_done () {
# Test the binaries we have just built. The tests are kept in
# t/ subdirectory and are run in trash subdirectory.
-PATH=$(pwd)/..:$PATH
-GIT_EXEC_PATH=$(pwd)/..
-GIT_TEMPLATE_DIR=$(pwd)/../templates/blt
+[ -z "$GIT_TEST_DIR" ] && GIT_TEST_DIR=$(pwd)
+PATH=$GIT_TEST_DIR/..:$PATH
+GIT_EXEC_PATH=$GIT_TEST_DIR/..
+GIT_TEMPLATE_DIR=$GIT_TEST_DIR/../templates/blt
unset GIT_CONFIG
unset GIT_CONFIG_LOCAL
GIT_CONFIG_NOSYSTEM=1
GIT_CONFIG_NOGLOBAL=1
export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL
-GITPERLLIB=$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git
+GITPERLLIB=$GIT_TEST_DIR/../perl/blib/lib:$GIT_TEST_DIR/../perl/blib/arch/auto/Git
export GITPERLLIB
-test -d ../templates/blt || {
+test -d "$GIT_TEMPLATE_DIR" || {
error "You haven't built things yet, have you?"
}
-if ! test -x ../test-chmtime; then
+if ! test -x $GIT_TEST_DIR/../test-chmtime; then
echo >&2 'You need to build test-chmtime:'
echo >&2 'Run "make test-chmtime" in the source (toplevel) directory'
exit 1
fi
-. ../GIT-BUILD-OPTIONS
+. $GIT_TEST_DIR/../GIT-BUILD-OPTIONS
# Test repository
test="trash directory"
--
1.5.5.3
next reply other threads:[~2008-06-12 19:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-12 19:13 Santi Béjar [this message]
2008-06-12 19:13 ` [PATCH] contrib/what: "git status" for am/bisect/cherry-pick/merge/rebase/revert Santi Béjar
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=1213298033-6086-1-git-send-email-sbejar@gmail.com \
--to=sbejar@gmail.com \
--cc=git@vger.kernel.org \
/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).