From 94a2bb56b34eaed77a6d21962999716c2104be1a Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Tue, 12 Jun 2018 23:10:37 -0400 Subject: git-credential-netrc: minor whitespace cleanup in test script Signed-off-by: Todd Zullinger Signed-off-by: Junio C Hamano --- contrib/credential/netrc/t-git-credential-netrc.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'contrib') diff --git a/contrib/credential/netrc/t-git-credential-netrc.sh b/contrib/credential/netrc/t-git-credential-netrc.sh index 58191a62f8..c5661087fe 100755 --- a/contrib/credential/netrc/t-git-credential-netrc.sh +++ b/contrib/credential/netrc/t-git-credential-netrc.sh @@ -17,15 +17,15 @@ # 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 test_external \ - 'git-credential-netrc' \ - perl "$TEST_DIRECTORY"/../contrib/credential/netrc/test.pl + 'git-credential-netrc' \ + perl "$TEST_DIRECTORY"/../contrib/credential/netrc/test.pl test_done ) -- cgit v1.2.3 From 04f673d7e47ba8aa413a47038abfc76b16d6c23b Mon Sep 17 00:00:00 2001 From: Luis Marsano Date: Tue, 12 Jun 2018 23:10:38 -0400 Subject: git-credential-netrc: use in-tree Git.pm for tests The netrc test.pl script calls git-credential-netrc which imports the Git module. Pass GITPERLLIB to git-credential-netrc via PERL5LIB to ensure the in-tree Git module is used for testing. Signed-off-by: Luis Marsano Signed-off-by: Junio C Hamano --- contrib/credential/netrc/t-git-credential-netrc.sh | 3 ++- contrib/credential/netrc/test.pl | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib') diff --git a/contrib/credential/netrc/t-git-credential-netrc.sh b/contrib/credential/netrc/t-git-credential-netrc.sh index c5661087fe..07227d0228 100755 --- a/contrib/credential/netrc/t-git-credential-netrc.sh +++ b/contrib/credential/netrc/t-git-credential-netrc.sh @@ -23,9 +23,10 @@ # 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 + 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..2b5280ad6a 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; -- cgit v1.2.3 From 9347166d5d4a07d20e32f45b92435bb788425f1e Mon Sep 17 00:00:00 2001 From: Luis Marsano Date: Tue, 12 Jun 2018 23:10:39 -0400 Subject: git-credential-netrc: fix exit status when tests fail Signed-off-by: Luis Marsano Signed-off-by: Junio C Hamano --- contrib/credential/netrc/test.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/credential/netrc/test.pl b/contrib/credential/netrc/test.pl index 2b5280ad6a..c0fb3718b2 100755 --- a/contrib/credential/netrc/test.pl +++ b/contrib/credential/netrc/test.pl @@ -11,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; @@ -103,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 @_; -- cgit v1.2.3 From 04542b6012a48ddbc45f1dc13fb189ae3946a130 Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Tue, 12 Jun 2018 23:10:36 -0400 Subject: git-credential-netrc: make "all" default target of Makefile Running "make" in contrib/credential/netrc should run the "all" target rather than the "test" target. Add an empty "all::" target like most of our other Makefiles. Signed-off-by: Todd Zullinger Signed-off-by: Junio C Hamano --- contrib/credential/netrc/Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'contrib') 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 -- cgit v1.2.3