1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
test_description='Check the build without Lua'
. ./setup.sh
nolua="$TEST_OUTPUT_DIRECTORY/../build/nolua/cgit"
test_lazy_prereq CGIT_NOLUA 'test -x "$nolua"'
test_have_prereq CGIT_NOLUA || {
skip_all='Skipping the Lua-less checks: build/nolua/cgit is missing, run make test'
test_done
}
if test -n "$CGIT_TEST_VALGRIND"
then
CGIT_VALGRIND_BINARY=$nolua
export CGIT_VALGRIND_BINARY
else
PATH="${nolua%/cgit}:$PATH"
fi
test_expect_success 'the binary reports no Lua' '
cgit --version >tmp &&
grep -F "[-] Lua scripting" tmp
'
test_expect_success 'it serves a page' '
cgitrc_repo plainrc foo &&
cgit_ok plainrc "url=foo/log/" >tmp &&
grep ">commit 5</a>" tmp
'
test_expect_success 'an exec filter still runs' '
cgitrc_repo execrc foo "repo.commit-filter=exec:$FILTER_DIRECTORY/dump.sh" &&
cgit_ok execrc "url=foo/commit/" >tmp &&
grep "COMMIT 5" tmp
'
test_expect_success 'a lua filter is refused with one error page' '
cgitrc_repo luarc foo "repo.commit-filter=lua:$FILTER_DIRECTORY/dump.lua" &&
cgit_rc luarc "url=foo/commit/" >tmp 2>err &&
grep "^Status: 500" tmp &&
test $(grep -c "^Status:" tmp) = 1 &&
grep "Built without Lua" err
'
test_done
|