From 19eedac4f39b845b345b76e7a56a794b2ff9ed57 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 09:50:21 -1000 Subject: Skip the perl helper tests where perl will not run The PERL prerequisite comes from NO_PERL in the build options, not from an interpreter being there, so a host without perl and with the chain linter off failed these tests instead of skipping them. --- tests/t0003-cache.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests/t0003-cache.sh') diff --git a/tests/t0003-cache.sh b/tests/t0003-cache.sh index d8051d9..91ed01f 100755 --- a/tests/t0003-cache.sh +++ b/tests/t0003-cache.sh @@ -23,6 +23,12 @@ request_all_pages() { done } +# The PERL prerequisite says only that the build allows perl, so the tests +# with perl helpers ask the interpreter itself, and skip where it is missing. +test_lazy_prereq PERL_RUNS ' + "$PERL_PATH" -e 1 +' + # Runs a command while holding the flock on the file named first, as another # request at work on the same lock would. write_hold_lock() { @@ -477,7 +483,7 @@ test_expect_success STRACE_DELAY 'a lock taken after the rename leaves the slot # may hold the slot's lock file only as the stdout it writes the page to. A # stray copy would keep the slot locked for as long as the filter, or # anything it leaves running, lives on. -test_expect_success PERL 'a filter holds the lock file only as its stdout' ' +test_expect_success PERL_RUNS 'a filter holds the lock file only as its stdout' ' rm -rf cache3 && mkdir cache3 && write_script fd-filter "$PERL_PATH" <<-\EOF && use POSIX qw(fstat); @@ -518,7 +524,7 @@ test_expect_success SANITY 'a refresh that cannot lock serves the expired slot a # A refresh that finds the lock held is another request already at work on # the slot, so the expired copy is served and nothing is logged. -test_expect_success PERL 'a refresh finding the lock held serves the expired slot quietly' ' +test_expect_success PERL_RUNS 'a refresh finding the lock held serves the expired slot quietly' ' write_hold_lock && rm -rf cache3 && mkdir cache3 && cgit_ok bigkeyrc "url=bigpage/" >/dev/null && @@ -589,7 +595,7 @@ test_expect_success 'a scan whose list cannot be written lists each repository o # A request that finds the scan's lock held and has no list to go on scans # in its own process, leaving the file to the holder. That is only another # request at work and no cause for a line in the log. -test_expect_success PERL 'a scan finding its lock held runs uncached' ' +test_expect_success PERL_RUNS 'a scan finding its lock held runs uncached' ' write_hold_lock && rm "cache5/$scanned_rc" && CGIT_CONFIG="$PWD/scanrc" QUERY_STRING="url=" \ -- cgit 2.12.1