From 37ae1c87f2f107580e725618d413fc94614a4622 Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Sat, 10 Feb 2024 23:21:51 +0100 Subject: [PATCH] Also report skipped tests --- run-upstream-testsuite.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/run-upstream-testsuite.sh b/run-upstream-testsuite.sh index 7f3db0f..8a55ba8 100755 --- a/run-upstream-testsuite.sh +++ b/run-upstream-testsuite.sh @@ -7,10 +7,12 @@ tempdir=$(mktemp -d) cd "$tempdir" # Check out the upstream test suite -git clone -n --depth=1 --filter=tree:0 https://git.savannah.gnu.org/git/diffutils.git +testsuite="https://git.savannah.gnu.org/git/diffutils.git" +echo "Fetching upstream test suite from $testsuite" +git clone -n --depth=1 --filter=tree:0 "$testsuite" &> /dev/null cd diffutils -git sparse-checkout set --no-cone tests -git checkout +git sparse-checkout set --no-cone tests &> /dev/null +git checkout &> /dev/null # Ensure that calling `diff` invokes the built binary instead of # the upstream binary that is most likely installed on the system @@ -22,18 +24,22 @@ cd ../tests # Get a list of all upstream tests and run only those that invoke `diff` echo -e '\n\nprinttests:\n\t@echo "${TESTS}"' >> Makefile.am tests=$(make -f Makefile.am printtests) +echo "Running $(echo "$tests" | wc -w) tests" export LC_ALL=C pass="$(tput setaf 2)PASS$(tput sgr0)" fail="$(tput setaf 1)FAIL$(tput sgr0)" +skip=SKIP exitcode=0 for test in $tests do + result=$fail if ! grep -E -s -q "(cmp|diff3|sdiff)" "$test" then - result=$fail sh "$test" &> /dev/null && result=$pass || exitcode=1 - printf "%-40s $result\n" "$test" + else + result=$skip fi + printf " %-40s $result\n" "$test" done # Clean up