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
This commit is contained in:
Junio C Hamano 2018-06-28 12:53:33 -07:00
Родитель 18404434bf 04542b6012
Коммит cf22247b63
3 изменённых файлов: 11 добавлений и 6 удалений

Просмотреть файл

@ -1,3 +1,6 @@
# The default target of this Makefile is...
all::
test:
./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
)

Просмотреть файл

@ -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 @_;