aboutsummaryrefslogtreecommitdiffstats
path: root/tests/setup.sh
diff options
context:
space:
mode:
authorJason A. Donenfeld2014-01-20 13:11:10 +0100
committerJason A. Donenfeld2014-01-20 13:11:10 +0100
commitf759cc0f08c195940de05d5394f7b1ad4d44365e (patch)
treee67ad33c58aced179929d5f5c5665745d56e90f9 /tests/setup.sh
parent6a1563343c48f9e38b85f39f4a95c89ea0f46a60 (diff)
downloadcgit-f759cc0f08c195940de05d5394f7b1ad4d44365e.tar.gz
cgit-f759cc0f08c195940de05d5394f7b1ad4d44365e.tar.bz2
cgit-f759cc0f08c195940de05d5394f7b1ad4d44365e.zip
tests: only do lua tests if lua is compiled-in
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tests/setup.sh')
-rwxr-xr-xtests/setup.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/setup.sh b/tests/setup.sh
index 785edd7..7590f04 100755
--- a/tests/setup.sh
+++ b/tests/setup.sh
@@ -60,6 +60,12 @@ fi
60 60
61FILTER_DIRECTORY=$(cd ../filters && pwd) 61FILTER_DIRECTORY=$(cd ../filters && pwd)
62 62
63if cgit --version | grep -F -q "[+] Lua scripting"; then
64 export CGIT_HAS_LUA=1
65else
66 export CGIT_HAS_LUA=0
67fi
68
63mkrepo() { 69mkrepo() {
64 name=$1 70 name=$1
65 count=$2 71 count=$2
@@ -133,7 +139,10 @@ repo.commit-filter=exec:$FILTER_DIRECTORY/dump.sh
133repo.email-filter=exec:$FILTER_DIRECTORY/dump.sh 139repo.email-filter=exec:$FILTER_DIRECTORY/dump.sh
134repo.source-filter=exec:$FILTER_DIRECTORY/dump.sh 140repo.source-filter=exec:$FILTER_DIRECTORY/dump.sh
135repo.readme=master:a+b 141repo.readme=master:a+b
142EOF
136 143
144 if [ $CGIT_HAS_LUA -eq 1 ]; then
145 cat >>cgitrc <<EOF
137repo.url=filter-lua 146repo.url=filter-lua
138repo.path=$PWD/repos/filter/.git 147repo.path=$PWD/repos/filter/.git
139repo.desc=filtered repo 148repo.desc=filtered repo
@@ -143,6 +152,7 @@ repo.email-filter=lua:$FILTER_DIRECTORY/dump.lua
143repo.source-filter=lua:$FILTER_DIRECTORY/dump.lua 152repo.source-filter=lua:$FILTER_DIRECTORY/dump.lua
144repo.readme=master:a+b 153repo.readme=master:a+b
145EOF 154EOF
155 fi
146} 156}
147 157
148cgit_query() 158cgit_query()
@@ -155,7 +165,7 @@ cgit_url()
155 CGIT_CONFIG="$PWD/cgitrc" QUERY_STRING="url=$1" cgit 165 CGIT_CONFIG="$PWD/cgitrc" QUERY_STRING="url=$1" cgit
156} 166}
157 167
158strip_headers () { 168strip_headers() {
159 while read -r line 169 while read -r line
160 do 170 do
161 test -z "$line" && break 171 test -z "$line" && break