Tests of the "netrc" credential helper aren't prepared to handle
out-of-tree builds:
- They expect the "test.pl" script to be located relative to the build
directory, even though it is located in the source directory.
- They expect the built "git-credential-netrc" helper to be located
relative to the "test.pl" file, evne though it is loated in the
build directory.
This works alright as long as source and build directories are the same,
but starts to break apart with Meson.
Fix these first issue by using the new "GIT_SOURCE_DIR" variable to
locate the test script itself. And fix the second issue by introducing a
new environment variable "CREDENTIAL_NETRC_PATH" that can be set for
out-of-tree builds to locate the built credential helper.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
23 lines
431 B
Bash
Executable File
23 lines
431 B
Bash
Executable File
#!/bin/sh
|
|
(
|
|
cd ../../../t
|
|
test_description='git-credential-netrc'
|
|
. ./test-lib.sh
|
|
. "$TEST_DIRECTORY"/lib-perl.sh
|
|
|
|
skip_all_if_no_Test_More
|
|
|
|
# set up test repository
|
|
|
|
test_expect_success \
|
|
'set up test repository' \
|
|
'git config --add gpg.program test.git-config-gpg'
|
|
|
|
export PERL5LIB="$GITPERLLIB"
|
|
test_expect_success 'git-credential-netrc' '
|
|
perl "$GIT_SOURCE_DIR"/contrib/credential/netrc/test.pl
|
|
'
|
|
|
|
test_done
|
|
)
|