aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar YAEGASHI Takeshi <yaegashi@debian.org>2014-03-02 17:00:16 (JST)
committerGravatar YAEGASHI Takeshi <yaegashi@debian.org>2014-03-02 17:00:16 (JST)
commit667bf9f6ed38daac4e4d7e88903eb0f28319c165 (patch)
treed7d36d505fb3c183bdec673c6e294b27e1a12310 /tests
parent1f57ee005551ae7ee2b387f14eb7dd104a120ee3 (diff)
parentf2fa9c56e29ae32bbe5841e7bfe0217ada4e3df9 (diff)
downloadcgit-667bf9f6ed38daac4e4d7e88903eb0f28319c165.zip
cgit-667bf9f6ed38daac4e4d7e88903eb0f28319c165.tar.gz
Merge tag 'v0.10.1'
CGIT 0.10.1
Diffstat (limited to 'tests')
-rwxr-xr-xtests/setup.sh12
-rwxr-xr-xtests/t0111-filter.sh7
2 files changed, 17 insertions, 2 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
diff --git a/tests/t0111-filter.sh b/tests/t0111-filter.sh
index 730f1c0..2fdc366 100755
--- a/tests/t0111-filter.sh
+++ b/tests/t0111-filter.sh
@@ -3,7 +3,12 @@
3test_description='Check filtered content' 3test_description='Check filtered content'
4. ./setup.sh 4. ./setup.sh
5 5
6for prefix in exec lua 6prefixes="exec"
7if [ $CGIT_HAS_LUA -eq 1 ]; then
8 prefixes="$prefixes lua"
9fi
10
11for prefix in $prefixes
7do 12do
8 test_expect_success "generate filter-$prefix/tree/a%2bb" " 13 test_expect_success "generate filter-$prefix/tree/a%2bb" "
9 cgit_url 'filter-$prefix/tree/a%2bb' >tmp 14 cgit_url 'filter-$prefix/tree/a%2bb' >tmp