From ba810a9c7f9eba5a0694288018d0a884ee769010 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 17:23:03 -1000 Subject: Show the lua filter pass as skipped without Lua A build without Lua left the eight tests of that pass out of the run, where the rest of the script counts its Lua tests as skipped. --- tests/t0201-filters.sh | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/tests/t0201-filters.sh b/tests/t0201-filters.sh index 1f137b8..f9f1316 100755 --- a/tests/t0201-filters.sh +++ b/tests/t0201-filters.sh @@ -4,20 +4,17 @@ # page content to an outside program before it is written out. The checks in # the loop run once per kind of filter, the exec kind always and the lua kind # only where cgit was built with lua, because both have to produce the same -# page from the same repository. +# page from the same repository. Elsewhere the lua kind shows as skipped. test_description='Check filtered content' . ./setup.sh -prefixes="exec" -if test "$CGIT_HAS_LUA" -eq 1 -then - prefixes="$prefixes lua" -fi - -for prefix in $prefixes +for prefix in exec lua do - test_expect_success "generate filter-$prefix/tree/a%2bb" " + filter_prereq= + test "$prefix" = exec || filter_prereq=CGIT_LUA + + test_expect_success $filter_prereq "generate filter-$prefix/tree/a%2bb" " cgit_url 'filter-$prefix/tree/a%2bb' >tmp " @@ -25,33 +22,33 @@ do # to a filter and back. A missed flush reorders the page rather than # losing any of it, so the test below watches which side of the # filtered text the surrounding markup lands on. - test_expect_success "check whether the $prefix source filter works" ' + test_expect_success $filter_prereq "check whether the $prefix source filter works" ' grep "a+b HELLO$" tmp && tr -d "\n" flat.out && grep "a+b HELLO" flat.out ' - test_expect_success "generate filter-$prefix/about/" " + test_expect_success $filter_prereq "generate filter-$prefix/about/" " cgit_url 'filter-$prefix/about/' >tmp " - test_expect_success "check whether the $prefix about filter works" ' + test_expect_success $filter_prereq "check whether the $prefix about filter works" ' grep "
a+b /filter-$prefix/tree/ HELLO$" tmp ' - test_expect_success "generate filter-$prefix/commit/" " + test_expect_success $filter_prereq "generate filter-$prefix/commit/" " cgit_url 'filter-$prefix/commit/' >tmp " - test_expect_success "check whether the $prefix commit filter works" ' + test_expect_success $filter_prereq "check whether the $prefix commit filter works" ' grep "
ADD A+B" tmp ' - test_expect_success "check whether the $prefix email filter works for authors" ' + test_expect_success $filter_prereq "check whether the $prefix email filter works for authors" ' grep " commit A U THOR <AUTHOR@EXAMPLE.COM>" tmp ' - test_expect_success "check whether the $prefix email filter works for committers" ' + test_expect_success $filter_prereq "check whether the $prefix email filter works for committers" ' grep " commit C O MITTER <COMMITTER@EXAMPLE.COM>" tmp ' done -- cgit 2.12.1