test-bzr.sh, test-hg.sh: allow running from any dir

Set TEST_DIRECTORY to the t/ directory (if TEST_DIRECTORY is not already set) so that the user doesn't already have to be in the test directory to run these test scripts. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Based-on-patch-by: Richard Hansen <rhansen@bbn.com> Reviewed-by: Richard Hansen <rhansen@bbn.com> Signed-off-by: Richard Hansen <rhansen@bbn.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Felipe Contreras committed Nov 17, 2013 at 23:12 UTC d3243d738ddcf1a9cf6c8bd63f66c57080f1040b
2 files changed +4 -2
contrib/remote-helpers/test-bzr.sh
+2 -1
@@ -5,7 +5,8 @@
5
6 test_description='Test remote-bzr'
7
8 -. ./test-lib.sh
8 +test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/../../t
9 +. "$TEST_DIRECTORY"/test-lib.sh
10
11 if ! test_have_prereq PYTHON
12 then
contrib/remote-helpers/test-hg.sh
+2 -1
@@ -8,7 +8,8 @@
8
9 test_description='Test remote-hg'
10
11 -. ./test-lib.sh
11 +test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/../../t
12 +. "$TEST_DIRECTORY"/test-lib.sh
13
14 if ! test_have_prereq PYTHON
15 then