summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Johannes Schindelin <johannes.schindelin@gmx.de>2019-01-29 06:19:37 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-01-29 09:26:47 -0800
commitdd167a3001a18ca1e9bcb607dfbdffbfe5af2113 (patch)
treee7c0d72fe0b52b108daaec41b7f5b8dfe39f30a1 /t
parentt0061: workaround issues with --with-dashes and RUNTIME_PREFIX (diff)
downloadtgif-dd167a3001a18ca1e9bcb607dfbdffbfe5af2113.tar.xz
tests: optionally skip bin-wrappers/
This speeds up the tests by a bit on Windows, where running Unix shell scripts (and spawning processes) is not exactly a cheap operation. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rw-r--r--t/README9
-rw-r--r--t/test-lib.sh19
2 files changed, 22 insertions, 6 deletions
diff --git a/t/README b/t/README
index 11ce7675e3..063530234f 100644
--- a/t/README
+++ b/t/README
@@ -170,6 +170,15 @@ appropriately before running "make".
implied by other options like --valgrind and
GIT_TEST_INSTALLED.
+--no-bin-wrappers::
+ By default, the test suite uses the wrappers in
+ `../bin-wrappers/` to execute `git` and friends. With this option,
+ `../git` and friends are run directly. This is not recommended
+ in general, as the wrappers contain safeguards to ensure that no
+ files from an installed Git are used, but can speed up test runs
+ especially on platforms where running shell scripts is expensive
+ (most notably, Windows).
+
--root=<directory>::
Create "trash" directories used to store all temporary data during
testing under <directory>, instead of the t/ directory.
diff --git a/t/test-lib.sh b/t/test-lib.sh
index c790e98fd2..25e649c997 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -111,6 +111,8 @@ do
test -z "$HARNESS_ACTIVE" && quiet=t ;;
--with-dashes)
with_dashes=t ;;
+ --no-bin-wrappers)
+ no_bin_wrappers=t ;;
--no-color)
color= ;;
--va|--val|--valg|--valgr|--valgri|--valgrin|--valgrind)
@@ -1214,16 +1216,21 @@ then
PATH=$GIT_TEST_INSTALLED:$GIT_BUILD_DIR/t/helper:$PATH
GIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH}
else # normal case, use ../bin-wrappers only unless $with_dashes:
- git_bin_dir="$GIT_BUILD_DIR/bin-wrappers"
- if ! test -x "$git_bin_dir/git"
+ if test -n "$no_bin_wrappers"
then
- if test -z "$with_dashes"
+ with_dashes=t
+ else
+ git_bin_dir="$GIT_BUILD_DIR/bin-wrappers"
+ if ! test -x "$git_bin_dir/git"
then
- say "$git_bin_dir/git is not executable; using GIT_EXEC_PATH"
+ if test -z "$with_dashes"
+ then
+ say "$git_bin_dir/git is not executable; using GIT_EXEC_PATH"
+ fi
+ with_dashes=t
fi
- with_dashes=t
+ PATH="$git_bin_dir:$PATH"
fi
- PATH="$git_bin_dir:$PATH"
GIT_EXEC_PATH=$GIT_BUILD_DIR
if test -n "$with_dashes"
then