summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorBen Peart <benpeart@microsoft.com>2018-09-18 23:29:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-09-28 18:40:38 (GMT)
commit4cb54d0aa8e2b8de6f6bafd5c2baad0db5ce9dc7 (patch)
treeb2f76219d4bedfce84df037b2513a8f1b6d8a0af /t
parent5aacc63f1e8414a12105faa7647c4c11f8acd02d (diff)
downloadgit-4cb54d0aa8e2b8de6f6bafd5c2baad0db5ce9dc7.zip
git-4cb54d0aa8e2b8de6f6bafd5c2baad0db5ce9dc7.tar.gz
git-4cb54d0aa8e2b8de6f6bafd5c2baad0db5ce9dc7.tar.bz2
fsmonitor: update GIT_TEST_FSMONITOR support
Rename GIT_FSMONITOR_TEST to GIT_TEST_FSMONITOR for consistency with the other GIT_TEST_ special setups and properly document its use. Add logic in t/test-lib.sh to give a warning when the old variable is set to let people know they need to update their environment to use the new variable. Remove the outdated instructions on how to run the test suite utilizing fsmonitor now that it is properly documented in t/README. Signed-off-by: Ben Peart <Ben.Peart@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rw-r--r--t/README4
-rwxr-xr-xt/t1700-split-index.sh2
-rwxr-xr-xt/t7519-status-fsmonitor.sh7
-rw-r--r--t/test-lib.sh20
4 files changed, 25 insertions, 8 deletions
diff --git a/t/README b/t/README
index 56a4174..47165f7 100644
--- a/t/README
+++ b/t/README
@@ -319,6 +319,10 @@ GIT_TEST_OE_DELTA_SIZE=<n> exercises the uncommon pack-objects code
path where deltas larger than this limit require extra memory
allocation for bookkeeping.
+GIT_TEST_FSMONITOR=$PWD/t7519/fsmonitor-all exercises the fsmonitor
+code path for utilizing a file system monitor to speed up detecting
+new or changed files.
+
Naming Tests
------------
diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
index b3b4d83..f6a856f 100755
--- a/t/t1700-split-index.sh
+++ b/t/t1700-split-index.sh
@@ -6,7 +6,7 @@ test_description='split index mode tests'
# We need total control of index splitting here
sane_unset GIT_TEST_SPLIT_INDEX
-sane_unset GIT_FSMONITOR_TEST
+sane_unset GIT_TEST_FSMONITOR
test_expect_success 'enable split index' '
git config splitIndex.maxPercentChange 100 &&
diff --git a/t/t7519-status-fsmonitor.sh b/t/t7519-status-fsmonitor.sh
index 756beb0..06f5982 100755
--- a/t/t7519-status-fsmonitor.sh
+++ b/t/t7519-status-fsmonitor.sh
@@ -4,13 +4,6 @@ test_description='git status with file system watcher'
. ./test-lib.sh
-#
-# To run the entire git test suite using fsmonitor:
-#
-# copy t/t7519/fsmonitor-all to a location in your path and then set
-# GIT_FSMONITOR_TEST=fsmonitor-all and run your tests.
-#
-
# Note, after "git reset --hard HEAD" no extensions exist other than 'TREE'
# "git update-index --fsmonitor" can be used to get the extension written
# before testing the results.
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 44288cb..653688c 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -140,6 +140,26 @@ then
export GIT_INDEX_VERSION
fi
+check_var_migration () {
+ old_name=$1 new_name=$2
+ eval "old_isset=\${${old_name}:+isset}"
+ eval "new_isset=\${${new_name}:+isset}"
+ case "$old_isset,$new_isset" in
+ isset,)
+ echo >&2 "warning: $old_name is now $new_name"
+ echo >&2 "hint: set $new_name too during the transition period"
+ eval "$new_name=\$$old_name"
+ ;;
+ isset,isset)
+ # do this later
+ # echo >&2 "warning: $old_name is now $new_name"
+ # echo >&2 "hint: remove $old_name"
+ ;;
+ esac
+}
+
+check_var_migration GIT_FSMONITOR_TEST GIT_TEST_FSMONITOR
+
# Add libc MALLOC and MALLOC_PERTURB test
# only if we are not executing the test with valgrind
if expr " $GIT_TEST_OPTS " : ".* --valgrind " >/dev/null ||