Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Stop the run when the Lua probe fails
The probe piped cgit into grep, so a crash or a sanitizer abort while
probing read as a missing module, and t0501, t0504 and t0505 then
expected the fallback on a machine that has the module.
Diffstat (limited to 'tests/extensions')
| -rw-r--r-- | tests/extensions/lib.sh | 16 |
1 file changed, 14 insertions, 2 deletions
diff --git a/tests/extensions/lib.sh b/tests/extensions/lib.sh index 92db245..4ca7522 100644 --- a/tests/extensions/lib.sh +++ b/tests/extensions/lib.sh @@ -27,7 +27,9 @@ test -n "$interpreters" || # Asks whether cgit's own Lua can require every module named, by pointing a # throwaway commit-filter at the given repository and reading its answer off # the rendered commit page. Filters need a page to run on, which is why a -# repository has to be handed in. +# repository has to be handed in. A probe that crashes or answers neither +# way stops the run, since reading it as a missing module would switch the +# tests to the wrong expectations. cgit_lua_probe() { test "$CGIT_HAS_LUA" -eq 1 || return 1 cgit_lua_probe_gitdir=$1 @@ -54,5 +56,15 @@ repo.url=lua-probe repo.path=$cgit_lua_probe_gitdir repo.commit-filter=lua:$PWD/lua-probe.lua EOF - CGIT_CONFIG="$PWD/lua-probe-cgitrc" QUERY_STRING="url=lua-probe/commit/" cgit | grep -q LUA_PROBE_YES + CGIT_CONFIG="$PWD/lua-probe-cgitrc" QUERY_STRING="url=lua-probe/commit/" \ + cgit >lua-probe.out 2>lua-probe.err || + BAIL_OUT "cgit failed while probing its Lua for $*" + if grep LUA_PROBE_YES lua-probe.out >/dev/null + then + return 0 + elif grep LUA_PROBE_NO lua-probe.out >/dev/null + then + return 1 + fi + BAIL_OUT "probing cgit's Lua for $* gave no answer" } |
