Diff options
Diffstat (limited to 'tests/setup.sh')
| -rwxr-xr-x | tests/setup.sh | 27 |
1 file changed, 23 insertions, 4 deletions
diff --git a/tests/setup.sh b/tests/setup.sh index 6e2e3f0..c035606 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -81,14 +81,33 @@ fi FILTER_DIRECTORY=$(cd "$TEST_OUTPUT_DIRECTORY/filters" && pwd) # Lua filters only work when cgit was compiled with Lua, so the tests that use -# them have to ask the binary rather than assume. -if cgit --version | grep -F -q "[+] Lua scripting" -then +# them have to ask the binary rather than assume. A cgit that cannot print its +# version stops the run rather than reading as one built without Lua, and the +# answer has to agree with the flags the binary was built with. +cgit_version=$(cgit --version) || + BAIL_OUT "cgit --version failed, so the binary under test is broken" +case "$cgit_version" in +*"[+] Lua scripting"*) CGIT_HAS_LUA=1 test_set_prereq CGIT_LUA -else + ;; +*) CGIT_HAS_LUA=0 + ;; +esac +cgit_flags="$TEST_OUTPUT_DIRECTORY/../build/CGIT-CFLAGS" +if test -z "$cgit_valgrind" && test -f "$cgit_flags" +then + if grep -e "-DNO_LUA" "$cgit_flags" >/dev/null + then + test "$CGIT_HAS_LUA" = 0 || + BAIL_OUT "cgit reports Lua but was built with NO_LUA" + else + test "$CGIT_HAS_LUA" = 1 || + BAIL_OUT "cgit was built with Lua but its version does not say so" + fi fi +unset cgit_version cgit_flags # Creates a repository holding the given number of one file commits. A third # argument asks for a variant, either testplus for a file and a branch whose |
