Skip to content

Commit 1b19ccd

Browse files
peffgitster
authored andcommitted
tests: skip perl tests if NO_PERL is defined
These scripts all test git programs that are written in perl, and thus obviously won't work if NO_PERL is defined. We pass NO_PERL to the scripts from the building Makefile via the GIT-BUILD-OPTIONS file. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 499c293 commit 1b19ccd

12 files changed

+48
-2
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,7 @@ GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS
14221422
@echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@
14231423
@echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
14241424
@echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@
1425+
@echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@
14251426

14261427
### Detect Tck/Tk interpreter path changes
14271428
ifndef NO_TCLTK

t/lib-git-svn.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ then
88
say 'skipping git svn tests, NO_SVN_TESTS defined'
99
test_done
1010
fi
11+
if ! test_have_prereq PERL; then
12+
say 'skipping git svn tests, perl not available'
13+
test_done
14+
fi
1115

1216
GIT_DIR=$PWD/.git
1317
GIT_SVN_DIR=$GIT_DIR/svn/git-svn

t/t3701-add-interactive.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
test_description='add -i basic tests'
44
. ./test-lib.sh
55

6+
if ! test_have_prereq PERL; then
7+
say 'skipping git add -i tests, perl not available'
8+
test_done
9+
fi
10+
611
test_expect_success 'setup (initial)' '
712
echo content >file &&
813
git add file &&

t/t7501-commit.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test_expect_success \
3838
"echo King of the bongo >file &&
3939
test_must_fail git commit -m foo -a file"
4040

41-
test_expect_success \
41+
test_expect_success PERL \
4242
"using paths with --interactive" \
4343
"echo bong-o-bong >file &&
4444
! (echo 7 | git commit -m foo --interactive file)"
@@ -119,7 +119,7 @@ test_expect_success \
119119
"echo 'gak' >file && \
120120
git commit -m 'author' --author 'Rubber Duck <rduck@convoy.org>' -a"
121121

122-
test_expect_success \
122+
test_expect_success PERL \
123123
"interactive add" \
124124
"echo 7 | git commit --interactive | grep 'What now'"
125125

t/t9001-send-email.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
test_description='git send-email'
44
. ./test-lib.sh
55

6+
if ! test_have_prereq PERL; then
7+
say 'skipping git send-email tests, perl not available'
8+
test_done
9+
fi
10+
611
PROG='git send-email'
712
test_expect_success \
813
'prepare reference tree' \

t/t9200-git-cvsexportcommit.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ test_description='Test export of commits to CVS'
66

77
. ./test-lib.sh
88

9+
if ! test_have_prereq PERL; then
10+
say 'skipping git cvsexportcommit tests, perl not available'
11+
test_done
12+
fi
13+
914
cvs >/dev/null 2>&1
1015
if test $? -ne 1
1116
then

t/t9400-git-cvsserver-server.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ cvs CLI client via git-cvsserver server'
1010

1111
. ./test-lib.sh
1212

13+
if ! test_have_prereq PERL; then
14+
say 'skipping git cvsserver tests, perl not available'
15+
test_done
16+
fi
1317
cvs >/dev/null 2>&1
1418
if test $? -ne 1
1519
then

t/t9401-git-cvsserver-crlf.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ then
5252
say 'skipping git-cvsserver tests, cvs not found'
5353
test_done
5454
fi
55+
if ! test_have_prereq PERL
56+
then
57+
say 'skipping git-cvsserver tests, perl not available'
58+
test_done
59+
fi
5560
perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
5661
say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'
5762
test_done

t/t9500-gitweb-standalone-no-errors.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ gitweb_run () {
6565

6666
. ./test-lib.sh
6767

68+
if ! test_have_prereq PERL; then
69+
say 'skipping gitweb tests, perl not available'
70+
test_done
71+
fi
72+
6873
perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || {
6974
say 'skipping gitweb tests, perl version is too old'
7075
test_done

t/t9600-cvsimport.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
test_description='git cvsimport basic tests'
44
. ./test-lib.sh
55

6+
if ! test_have_prereq PERL; then
7+
say 'skipping git cvsimport tests, perl not available'
8+
test_done
9+
fi
10+
611
CVSROOT=$(pwd)/cvsroot
712
export CVSROOT
813
unset CVS_SERVER

0 commit comments

Comments
 (0)