summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-07-28 20:18:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-07-28 20:18:05 (GMT)
commit1d07640b65d67d4a0fc657b5d09c3933e6e41ea6 (patch)
tree25e3d9bb7d3c67c79c9fe5f59cdf755e49895d2f
parent7f554a4f694dc5e9a3cb42887546a121ff9d2b93 (diff)
parentade15525987a2e108fe6b6dd1a2ba4d963d64f13 (diff)
downloadgit-1d07640b65d67d4a0fc657b5d09c3933e6e41ea6.zip
git-1d07640b65d67d4a0fc657b5d09c3933e6e41ea6.tar.gz
git-1d07640b65d67d4a0fc657b5d09c3933e6e41ea6.tar.bz2
Merge branch 'ps/t0000-output-directory-fix'
"TEST_OUTPUT_DIRECTORY=there make test" failed to work, which has been corrected. * ps/t0000-output-directory-fix: t0000: fix test if run with TEST_OUTPUT_DIRECTORY
-rwxr-xr-xt/t0000-basic.sh7
-rw-r--r--t/test-lib.sh9
2 files changed, 14 insertions, 2 deletions
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index f68c27d..cb87768 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -106,8 +106,11 @@ _run_sub_test_lib_test_common () {
EOF
cat >>"$name.sh" &&
export TEST_DIRECTORY &&
- TEST_OUTPUT_DIRECTORY=$(pwd) &&
- export TEST_OUTPUT_DIRECTORY &&
+ # The child test re-sources GIT-BUILD-OPTIONS and may thus
+ # override the test output directory. We thus pass it as an
+ # explicit override to the child.
+ TEST_OUTPUT_DIRECTORY_OVERRIDE=$(pwd) &&
+ export TEST_OUTPUT_DIRECTORY_OVERRIDE &&
GIT_SKIP_TESTS=$skip &&
export GIT_SKIP_TESTS &&
sane_unset GIT_TEST_FAIL_PREREQS &&
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 9e26860..da13190 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -57,6 +57,15 @@ fi
. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
export PERL_PATH SHELL_PATH
+# In t0000, we need to override test directories of nested testcases. In case
+# the developer has TEST_OUTPUT_DIRECTORY part of his build options, then we'd
+# reset this value to instead contain what the developer has specified. We thus
+# have this knob to allow overriding the directory.
+if test -n "${TEST_OUTPUT_DIRECTORY_OVERRIDE}"
+then
+ TEST_OUTPUT_DIRECTORY="${TEST_OUTPUT_DIRECTORY_OVERRIDE}"
+fi
+
# Disallow the use of abbreviated options in the test suite by default
if test -z "${GIT_TEST_DISALLOW_ABBREVIATED_OPTIONS}"
then