Skip to content

Commit

Permalink
Also report skipped tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oSoMoN committed Feb 10, 2024
1 parent 15ba584 commit 37ae1c8
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions run-upstream-testsuite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 37ae1c8

Please sign in to comment.