@matheusbsbs / matheus-bagliano / commits / be38ca3d19
Fork 0

Make sure $PERL_PATH is defined when the test suite is run.

Some test scripts run Perl scripts as if they were git-* scripts, and thus need to use the same perl that will be put in the shebang line of git*.perl commands. $PERL_PATH therefore needs to be used instead of a bare "perl". The tests can fail if another perl is found in $PATH before the one defined in $PERL_PATH. Example test failure caused by this: the perl defined in $PERL_PATH has Error.pm installed, and therefore the Git.pm's Makefile.PL doesn't install the private copy. The perl from $PATH doesn't have Error.pm installed, and all git*.perl scripts invoked during the test will fail loading Error.pm. Makefile patch by Jeff King <peff@peff.net>. Signed-off-by: Philippe Bruhat (BooK) <book@cpan.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Philippe Bruhat (BooK) committed Nov 17, 2009 at 09:42 UTC be38ca3d19be50be447e1c5952f53fa70bf21a1c
4 files changed +5 -4
Makefile
+1
@@ -1626,6 +1626,7 @@ GIT-CFLAGS: .FORCE-GIT-CFLAGS
1626 # and the first level quoting from the shell that runs "echo".
1627 GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS
1628 @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@
1629 + @echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@
1630 @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
1631 @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@
1632 @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@
t/t9400-git-cvsserver-server.sh
+1 -1
@@ -20,7 +20,7 @@ then
20 say 'skipping git-cvsserver tests, cvs not found'
21 test_done
22 fi
23 -perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
23 +"$PERL_PATH" -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
24 say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'
25 test_done
26 }
t/t9401-git-cvsserver-crlf.sh
+1 -1
@@ -57,7 +57,7 @@ then
57 say 'skipping git-cvsserver tests, perl not available'
58 test_done
59 fi
60 -perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
60 +"$PERL_PATH" -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
61 say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'
62 test_done
63 }
t/t9700-perl-git.sh
+2 -2
@@ -11,7 +11,7 @@ if ! test_have_prereq PERL; then
11 test_done
12 fi
13
14 -perl -MTest::More -e 0 2>/dev/null || {
14 +"$PERL_PATH" -MTest::More -e 0 2>/dev/null || {
15 say "Perl Test::More unavailable, skipping test"
16 test_done
17 }
@@ -48,6 +48,6 @@ test_expect_success \
48
49 test_external_without_stderr \
50 'Perl API' \
51 - perl "$TEST_DIRECTORY"/t9700/test.pl
51 + "$PERL_PATH" "$TEST_DIRECTORY"/t9700/test.pl
52
53 test_done