From e077e08aa50a2ae654b529058f153a5ea7a01476 Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Wed, 1 Apr 2026 10:00:22 -0700 Subject: [PATCH] Fix GNU test suite reporting real pass/fail results MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The GNU tar test suite's version.at (test 1) creates a .badversion file when `tar --version` doesn't match the expected GNU tar output. This causes AT_XFAIL_IF to mark every subsequent test as "expected failure", hiding real results — all tests appear as XFAIL instead of actual PASS or FAIL. Fix this by: - Generating the testsuite script first via `make -C tests testsuite` - Patching it to redirect the .badversion write to /dev/null - Removing any stale .badversion before running - Touching src/tar after copy to prevent make from relinking it Co-Authored-By: Claude Opus 4.6 --- util/run-gnu-test.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/util/run-gnu-test.sh b/util/run-gnu-test.sh index 880e6cc..6a62ad2 100755 --- a/util/run-gnu-test.sh +++ b/util/run-gnu-test.sh @@ -39,4 +39,19 @@ echo "Running GNU tar tests..." # Run with timeout and make check # We use $* to pass any additional user arguments (e.g. TESTSUITEFLAGS="1-5") cp "${TAR}" src/tar +touch src/tar + +# Generate the testsuite script (without running it) +"${MAKE}" -C tests testsuite + +# Test 1 (version.at) checks `tar --version` against the expected GNU tar +# version string. When it doesn't match, it creates a .badversion file which +# causes AT_XFAIL_IF to mark *every* subsequent test as "expected failure", +# hiding real pass/fail results. Patch the generated testsuite script to +# prevent this. +sed 's|cat >$XFAILFILE|cat >/dev/null|' tests/testsuite > tests/testsuite.tmp +mv tests/testsuite.tmp tests/testsuite +chmod +x tests/testsuite +rm -f tests/.badversion + timeout -sKILL 4h "${MAKE}" -j "$("${NPROC}")" check "$@"