Skip to content

Commit

Permalink
test-lib: Allow overriding of TEST_DIRECTORY
Browse files Browse the repository at this point in the history
Tests that test the test-lib.sh itself need to be executed in the
dynamically created trash directory, so we can't assume
$TEST_DIRECTORY is ../ for those.

As a side benefit this change also makes it easy for us to move the
t/*.sh tests into subdirectories if we ever want to do that.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ævar Arnfjörð Bjarmason authored and Junio C Hamano committed Aug 31, 2010
1 parent 6cec5c6 commit 62f5390
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,13 @@ test_done () {

# Test the binaries we have just built. The tests are kept in
# t/ subdirectory and are run in 'trash directory' subdirectory.
TEST_DIRECTORY=$(pwd)
if test -z "$TEST_DIRECTORY"
then
# We allow tests to override this, in case they want to run tests
# outside of t/, e.g. for running tests on the test library
# itself.
TEST_DIRECTORY=$(pwd)
fi
GIT_BUILD_DIR="$TEST_DIRECTORY"/..

if test -n "$valgrind"
Expand Down

0 comments on commit 62f5390

Please sign in to comment.