test-bzr.sh, test-hg.sh: allow running from any dir
authorFelipe Contreras <felipe.contreras@gmail.com>
Mon, 18 Nov 2013 04:12:44 +0000 (23:12 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Nov 2013 21:45:57 +0000 (13:45 -0800)
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>
contrib/remote-helpers/test-bzr.sh
contrib/remote-helpers/test-hg.sh
index 5c5025178370813aabec64c8bfbd7ac59c6186a5..1e850c313d5484bed117f97d42f80d0473fdff49 100755 (executable)
@@ -5,7 +5,8 @@
 
 test_description='Test remote-bzr'
 
-. ./test-lib.sh
+test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/../../t
+. "$TEST_DIRECTORY"/test-lib.sh
 
 if ! test_have_prereq PYTHON
 then
index 72f745d63f2f225b4976b27875d726b4652198ed..fa7d17b224b4746928fb3def60a4d4f7b608a9d1 100755 (executable)
@@ -8,7 +8,8 @@
 
 test_description='Test remote-hg'
 
-. ./test-lib.sh
+test -n "$TEST_DIRECTORY" || TEST_DIRECTORY=${0%/*}/../../t
+. "$TEST_DIRECTORY"/test-lib.sh
 
 if ! test_have_prereq PYTHON
 then