diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-06-28 12:53:33 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-06-28 12:53:33 -0700 |
commit | cf22247b631ab7cdfe01289917583f84dfea6f32 (patch) | |
tree | 46107aeb223a6d24e02bd7cffbe592400fb2d391 /contrib | |
parent | 18404434bf406f6a6f892ed73320c5cf9cc187dd (diff) | |
parent | 04542b6012a48ddbc45f1dc13fb189ae3946a130 (diff) | |
download | git-cf22247b631ab7cdfe01289917583f84dfea6f32.tar.gz |
Merge branch 'tz/cred-netrc-cleanup'
Build and test procedure for netrc credential helper (in contrib/)
has been updated.
* tz/cred-netrc-cleanup:
git-credential-netrc: make "all" default target of Makefile
git-credential-netrc: fix exit status when tests fail
git-credential-netrc: use in-tree Git.pm for tests
git-credential-netrc: minor whitespace cleanup in test script
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/credential/netrc/Makefile | 3 | ||||
-rwxr-xr-x | contrib/credential/netrc/t-git-credential-netrc.sh | 9 | ||||
-rwxr-xr-x | contrib/credential/netrc/test.pl | 5 |
3 files changed, 11 insertions, 6 deletions
diff --git a/contrib/credential/netrc/Makefile b/contrib/credential/netrc/Makefile index 0ffa407191..6174e3bb83 100644 --- a/contrib/credential/netrc/Makefile +++ b/contrib/credential/netrc/Makefile @@ -1,3 +1,6 @@ +# The default target of this Makefile is... +all:: + test: ./t-git-credential-netrc.sh diff --git a/contrib/credential/netrc/t-git-credential-netrc.sh b/contrib/credential/netrc/t-git-credential-netrc.sh index 58191a62f8..07227d0228 100755 --- a/contrib/credential/netrc/t-git-credential-netrc.sh +++ b/contrib/credential/netrc/t-git-credential-netrc.sh @@ -17,15 +17,16 @@ # set up test repository test_expect_success \ - 'set up test repository' \ - 'git config --add gpg.program test.git-config-gpg' + 'set up test repository' \ + 'git config --add gpg.program test.git-config-gpg' # The external test will outputs its own plan test_external_has_tap=1 + export PERL5LIB="$GITPERLLIB" test_external \ - 'git-credential-netrc' \ - perl "$TEST_DIRECTORY"/../contrib/credential/netrc/test.pl + 'git-credential-netrc' \ + perl "$GIT_BUILD_DIR"/contrib/credential/netrc/test.pl test_done ) diff --git a/contrib/credential/netrc/test.pl b/contrib/credential/netrc/test.pl index 1e1001030e..c0fb3718b2 100755 --- a/contrib/credential/netrc/test.pl +++ b/contrib/credential/netrc/test.pl @@ -1,5 +1,4 @@ #!/usr/bin/perl -use lib (split(/:/, $ENV{GITPERLLIB})); use warnings; use strict; @@ -12,7 +11,6 @@ BEGIN { # t-git-credential-netrc.sh kicks off our testing, so we have to go # from there. Test::More->builder->current_test(1); - Test::More->builder->no_ending(1); } my @global_credential_args = @ARGV; @@ -104,6 +102,9 @@ $cred = run_credential( ['-f', $netrcGpg, '-g', 'test.command-option-gpg', 'get' ok(scalar keys %$cred == 2, 'Got keys decrypted by command option'); +my $is_passing = eval { Test::More->is_passing }; +exit($is_passing ? 0 : 1) unless $@ =~ /Can't locate object method/; + sub run_credential { my $args = shift @_; |