From 4c428b0412c4c0334a2bae1a90e8f494c5d05ce6 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 08:32:12 -1000 Subject: Let a test run require the tools it must not skip Nothing could make a missing prerequisite fail. A host without pkg-config builds without Lua, and make test then passed with every Lua test skipped and the lua pass of t0201 never run. The whole-script skips become named prerequisites so the same list covers them, and the strace probe now traces the file class of calls the tests use, so an strace too old for it skips rather than fails. --- tests/t0302-home-access.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/t0302-home-access.sh') diff --git a/tests/t0302-home-access.sh b/tests/t0302-home-access.sh index 6447927..0c0fcd2 100755 --- a/tests/t0302-home-access.sh +++ b/tests/t0302-home-access.sh @@ -11,14 +11,14 @@ test_description='Ensure that git does not access $HOME' . ./setup.sh # strace needs ptrace, which a system can refuse even where the binary is -# installed, so a working run is checked as well as a present binary. -command -v strace >/dev/null 2>&1 || { - skip_all='Skipping access validation tests: strace not found' - test_done -} - -strace true 2>/dev/null || { - skip_all='Skipping access validation tests: strace not functional' +# installed, and a release that knows the file class of calls, so the probe +# traces that class. +test_lazy_prereq STRACE ' + strace -o /dev/null -e trace=%file true +' + +test_have_prereq STRACE || { + skip_all='Skipping access validation tests: no strace that can trace here' test_done } -- cgit 2.12.1