Code

tests: use $TEST_DIRECTORY to refer to the t/ directory
authorJunio C Hamano <gitster@pobox.com>
Fri, 8 Aug 2008 09:26:28 +0000 (02:26 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 17 Aug 2008 07:41:52 +0000 (00:41 -0700)
commitbfdbee98109c5ad2dbbc392e7eed1ae688acc039
treecc430b09c2901ce38ac638e9e785aabb88e2e500
parent053fd0c1c3da20474c4ff175c56ea4c1d6eeda11
tests: use $TEST_DIRECTORY to refer to the t/ directory

Many test scripts assumed that they will start in a 'trash' subdirectory
that is a single level down from the t/ directory, and referred to their
test vector files by asking for files like "../t9999/expect".  This will
break if we move the 'trash' subdirectory elsewhere.

To solve this, we earlier introduced "$TEST_DIRECTORY" so that they can
refer to t/ directory reliably.  This finally makes all the tests use
it to refer to the outside environment.

With this patch, and a one-liner not included here (because it would
contradict with what Dscho really wants to do):

| diff --git a/t/test-lib.sh b/t/test-lib.sh
| index 70ea7e0..60e69e4 100644
| --- a/t/test-lib.sh
| +++ b/t/test-lib.sh
| @@ -485,7 +485,7 @@ fi
|  . ../GIT-BUILD-OPTIONS
|
|  # Test repository
| -test="trash directory"
| +test="trash directory/another level/yet another"
|  rm -fr "$test" || {
|         trap - exit
|         echo >&5 "FATAL: Cannot prepare test area"

all the tests still pass, but we would want extra sets of eyeballs on this
type of change to really make sure.

[jc: with help from Stephan Beyer on http-push tests I do not run myself;
 credits for locating silly quoting errors go to Olivier Marin.]

Signed-off-by: Junio C Hamano <gitster@pobox.com>
51 files changed:
t/lib-httpd.sh
t/t0022-crlf-rename.sh
t/t1000-read-tree-m-3way.sh
t/t3900-i18n-commit.sh
t/t3901-i18n-patch.sh
t/t4000-diff-format.sh
t/t4001-diff-rename.sh
t/t4002-diff-basic.sh
t/t4003-diff-rename-1.sh
t/t4004-diff-rename-symlink.sh
t/t4005-diff-rename-2.sh
t/t4007-rename-3.sh
t/t4008-diff-break-rewrite.sh
t/t4009-diff-rename-4.sh
t/t4010-diff-pathspec.sh
t/t4011-diff-symlink.sh
t/t4012-diff-binary.sh
t/t4013-diff-various.sh
t/t4015-diff-whitespace.sh
t/t4020-diff-external.sh
t/t4022-diff-rewrite.sh
t/t4023-diff-rename-typechange.sh
t/t4027-diff-submodule.sh
t/t4100-apply-stat.sh
t/t4101-apply-nonl.sh
t/t5100-mailinfo.sh
t/t5515-fetch-merge-logic.sh
t/t5540-http-push.sh
t/t6002-rev-list-bisect.sh
t/t6003-rev-list-topo-order.sh
t/t6023-merge-file.sh
t/t6027-merge-binary.sh
t/t6101-rev-parse-parents.sh
t/t6200-fmt-merge-msg.sh
t/t7001-mv.sh
t/t7004-tag.sh
t/t7101-reset.sh
t/t7500-commit.sh
t/t8001-annotate.sh
t/t8002-blame.sh
t/t9110-git-svn-use-svm-props.sh
t/t9111-git-svn-use-svnsync-props.sh
t/t9115-git-svn-dcommit-funky-renames.sh
t/t9121-git-svn-fetch-renamed-dir.sh
t/t9200-git-cvsexportcommit.sh
t/t9300-fast-import.sh
t/t9301-fast-export.sh
t/t9500-gitweb-standalone-no-errors.sh
t/t9700-perl-git.sh
t/t9700/test.pl
t/test-lib.sh