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>
Jeff King committed
Apr 3, 2009 at 15:33 UTC
1b19ccd236e3369ac77d74ded207406ffbf9feca
12 files changed
+48
-2
Makefile
+1
@@ -1422,6 +1422,7 @@ GIT-BUILD-OPTIONS: .FORCE-GIT-BUILD-OPTIONS
1422
@echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@
1423
@echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
1424
@echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@
1425
+ @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@
1426
1427
### Detect Tck/Tk interpreter path changes
1428
ifndef NO_TCLTK
t/lib-git-svn.sh
+4
@@ -8,6 +8,10 @@ then
8
say 'skipping git svn tests, NO_SVN_TESTS defined'
9
test_done
10
fi
11
+if ! test_have_prereq PERL; then
12
+ say 'skipping git svn tests, perl not available'
13
+ test_done
14
+fi
15
16
GIT_DIR=$PWD/.git
17
GIT_SVN_DIR=$GIT_DIR/svn/git-svn
t/t3701-add-interactive.sh
+5
@@ -3,6 +3,11 @@
3
test_description='add -i basic tests'
4
. ./test-lib.sh
5
6
+if ! test_have_prereq PERL; then
7
+ say 'skipping git add -i tests, perl not available'
8
+ test_done
9
+fi
10
+
11
test_expect_success 'setup (initial)' '
12
echo content >file &&
13
git add file &&
t/t7501-commit.sh
+2
-2
@@ -38,7 +38,7 @@ test_expect_success \
38
"echo King of the bongo >file &&
39
test_must_fail git commit -m foo -a file"
40
41
-test_expect_success \
41
+test_expect_success PERL \
42
"using paths with --interactive" \
43
"echo bong-o-bong >file &&
44
! (echo 7 | git commit -m foo --interactive file)"
@@ -119,7 +119,7 @@ test_expect_success \
119
"echo 'gak' >file && \
120
git commit -m 'author' --author 'Rubber Duck <rduck@convoy.org>' -a"
121
122
-test_expect_success \
122
+test_expect_success PERL \
123
"interactive add" \
124
"echo 7 | git commit --interactive | grep 'What now'"
125
t/t9001-send-email.sh
+5
@@ -3,6 +3,11 @@
3
test_description='git send-email'
4
. ./test-lib.sh
5
6
+if ! test_have_prereq PERL; then
7
+ say 'skipping git send-email tests, perl not available'
8
+ test_done
9
+fi
10
+
11
PROG='git send-email'
12
test_expect_success \
13
'prepare reference tree' \
t/t9200-git-cvsexportcommit.sh
+5
@@ -6,6 +6,11 @@ test_description='Test export of commits to CVS'
6
7
. ./test-lib.sh
8
9
+if ! test_have_prereq PERL; then
10
+ say 'skipping git cvsexportcommit tests, perl not available'
11
+ test_done
12
+fi
13
+
14
cvs >/dev/null 2>&1
15
if test $? -ne 1
16
then
t/t9400-git-cvsserver-server.sh
+4
@@ -10,6 +10,10 @@ cvs CLI client via git-cvsserver server'
10
11
. ./test-lib.sh
12
13
+if ! test_have_prereq PERL; then
14
+ say 'skipping git cvsserver tests, perl not available'
15
+ test_done
16
+fi
17
cvs >/dev/null 2>&1
18
if test $? -ne 1
19
then
t/t9401-git-cvsserver-crlf.sh
+5
@@ -52,6 +52,11 @@ then
52
say 'skipping git-cvsserver tests, cvs not found'
53
test_done
54
fi
55
+if ! test_have_prereq PERL
56
+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 || {
61
say 'skipping git-cvsserver tests, Perl SQLite interface unavailable'
62
test_done
t/t9500-gitweb-standalone-no-errors.sh
+5
@@ -65,6 +65,11 @@ gitweb_run () {
65
66
. ./test-lib.sh
67
68
+if ! test_have_prereq PERL; then
69
+ say 'skipping gitweb tests, perl not available'
70
+ test_done
71
+fi
72
+
73
perl -MEncode -e 'decode_utf8("", Encode::FB_CROAK)' >/dev/null 2>&1 || {
74
say 'skipping gitweb tests, perl version is too old'
75
test_done
t/t9600-cvsimport.sh
+5
@@ -3,6 +3,11 @@
3
test_description='git cvsimport basic tests'
4
. ./test-lib.sh
5
6
+if ! test_have_prereq PERL; then
7
+ say 'skipping git cvsimport tests, perl not available'
8
+ test_done
9
+fi
10
+
11
CVSROOT=$(pwd)/cvsroot
12
export CVSROOT
13
unset CVS_SERVER
t/t9700-perl-git.sh
+5
@@ -6,6 +6,11 @@
6
test_description='perl interface (Git.pm)'
7
. ./test-lib.sh
8
9
+if ! test_have_prereq PERL; then
10
+ say 'skipping perl interface tests, perl not available'
11
+ test_done
12
+fi
13
+
14
perl -MTest::More -e 0 2>/dev/null || {
15
say "Perl Test::More unavailable, skipping test"
16
test_done
t/test-lib.sh
+2
@@ -698,6 +698,8 @@ case $(uname -s) in
698
;;
699
esac
700
701
+test -z "$NO_PERL" && test_set_prereq PERL
702
+
703
# test whether the filesystem supports symbolic links
704
ln -s x y 2>/dev/null && test -h y 2>/dev/null && test_set_prereq SYMLINKS
705
rm -f y