summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-07-28 13:18:04 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-07-28 13:18:05 -0700
commit1d07640b65d67d4a0fc657b5d09c3933e6e41ea6 (patch)
tree25e3d9bb7d3c67c79c9fe5f59cdf755e49895d2f /t
parentMerge branch 'tb/reverse-midx' (diff)
parentt0000: fix test if run with TEST_OUTPUT_DIRECTORY (diff)
downloadtgif-1d07640b65d67d4a0fc657b5d09c3933e6e41ea6.tar.xz
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
Diffstat (limited to 't')
-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 f68c27d864..cb87768513 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 9e26860544..da13190970 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