diff options
Diffstat (limited to 'tests/setup.sh')
-rwxr-xr-x | tests/setup.sh | 12 |
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 | ||
61 | FILTER_DIRECTORY=$(cd ../filters && pwd) | 61 | FILTER_DIRECTORY=$(cd ../filters && pwd) |
62 | 62 | ||
63 | if cgit --version | grep -F -q "[+] Lua scripting"; then | ||
64 | export CGIT_HAS_LUA=1 | ||
65 | else | ||
66 | export CGIT_HAS_LUA=0 | ||
67 | fi | ||
68 | |||
63 | mkrepo() { | 69 | mkrepo() { |
64 | name=$1 | 70 | name=$1 |
65 | count=$2 | 71 | count=$2 |
@@ -133,7 +139,10 @@ repo.commit-filter=exec:$FILTER_DIRECTORY/dump.sh | |||
133 | repo.email-filter=exec:$FILTER_DIRECTORY/dump.sh | 139 | repo.email-filter=exec:$FILTER_DIRECTORY/dump.sh |
134 | repo.source-filter=exec:$FILTER_DIRECTORY/dump.sh | 140 | repo.source-filter=exec:$FILTER_DIRECTORY/dump.sh |
135 | repo.readme=master:a+b | 141 | repo.readme=master:a+b |
142 | EOF | ||
136 | 143 | ||
144 | if [ $CGIT_HAS_LUA -eq 1 ]; then | ||
145 | cat >>cgitrc <<EOF | ||
137 | repo.url=filter-lua | 146 | repo.url=filter-lua |
138 | repo.path=$PWD/repos/filter/.git | 147 | repo.path=$PWD/repos/filter/.git |
139 | repo.desc=filtered repo | 148 | repo.desc=filtered repo |
@@ -143,6 +152,7 @@ repo.email-filter=lua:$FILTER_DIRECTORY/dump.lua | |||
143 | repo.source-filter=lua:$FILTER_DIRECTORY/dump.lua | 152 | repo.source-filter=lua:$FILTER_DIRECTORY/dump.lua |
144 | repo.readme=master:a+b | 153 | repo.readme=master:a+b |
145 | EOF | 154 | EOF |
155 | fi | ||
146 | } | 156 | } |
147 | 157 | ||
148 | cgit_query() | 158 | cgit_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 | ||
158 | strip_headers () { | 168 | strip_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 |