# features. It is optional if you want to neither execute tests nor use any of
# these optional features.
perl_required = get_option('perl')
- if get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers')
-if get_option('benchmarks').enabled() or get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers') or get_option('docs') != []
++if get_option('benchmarks').enabled() or get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers')
perl_required = true
endif
TEST_NO_CREATE_REPO=t
TEST_NO_MALLOC_CHECK=t
- . ../test-lib.sh
+# GIT-BUILD-OPTIONS, sourced by test-lib.sh, overwrites the `GIT_PERF_*`
+# values that are set by the user (if any). Let's stash them away as
+# `eval`-able assignments.
+git_perf_settings="$(env |
+ sed -n "/^GIT_PERF_/{
+ # escape all single-quotes in the value
+ s/'/'\\\\''/g
+ # turn this into an eval-able assignment
+ s/^\\([^=]*=\\)\\(.*\\)/\\1'\\2'/p
+ }")"
+
+ # While test-lib.sh computes the build directory for us, we also have to do the
+ # same thing in order to locate the script via GIT-BUILD-OPTIONS in the first
+ # place.
+ GIT_BUILD_DIR="${GIT_BUILD_DIR:-$TEST_DIRECTORY/..}"
+ if test -f "$GIT_BUILD_DIR/GIT-BUILD-DIR"
+ then
+ GIT_BUILD_DIR="$(cat "$GIT_BUILD_DIR/GIT-BUILD-DIR")" || exit 1
+ # On Windows, we must convert Windows paths lest they contain a colon
+ case "$(uname -s)" in
+ *MINGW*)
+ GIT_BUILD_DIR="$(cygpath -au "$GIT_BUILD_DIR")"
+ ;;
+ esac
+ fi
+
+ if test ! -f "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
+ then
+ echo >&2 'error: GIT-BUILD-OPTIONS missing (has Git been built?).'
+ exit 1
+ fi
+
+ . "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
+ . "$GIT_SOURCE_DIR"/t/test-lib.sh
+
++# Then restore GIT_PERF_* settings.
+eval "$git_perf_settings"
+
unset GIT_CONFIG_NOSYSTEM
GIT_CONFIG_SYSTEM="$TEST_DIRECTORY/perf/config"
export GIT_CONFIG_SYSTEM