Skip to content

Commit 37ae1c8

Browse files
committed
Also report skipped tests
1 parent 15ba584 commit 37ae1c8

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

run-upstream-testsuite.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ tempdir=$(mktemp -d)
77
cd "$tempdir"
88

99
# Check out the upstream test suite
10-
git clone -n --depth=1 --filter=tree:0 https://git.savannah.gnu.org/git/diffutils.git
10+
testsuite="https://git.savannah.gnu.org/git/diffutils.git"
11+
echo "Fetching upstream test suite from $testsuite"
12+
git clone -n --depth=1 --filter=tree:0 "$testsuite" &> /dev/null
1113
cd diffutils
12-
git sparse-checkout set --no-cone tests
13-
git checkout
14+
git sparse-checkout set --no-cone tests &> /dev/null
15+
git checkout &> /dev/null
1416

1517
# Ensure that calling `diff` invokes the built binary instead of
1618
# the upstream binary that is most likely installed on the system
@@ -22,18 +24,22 @@ cd ../tests
2224
# Get a list of all upstream tests and run only those that invoke `diff`
2325
echo -e '\n\nprinttests:\n\t@echo "${TESTS}"' >> Makefile.am
2426
tests=$(make -f Makefile.am printtests)
27+
echo "Running $(echo "$tests" | wc -w) tests"
2528
export LC_ALL=C
2629
pass="$(tput setaf 2)PASS$(tput sgr0)"
2730
fail="$(tput setaf 1)FAIL$(tput sgr0)"
31+
skip=SKIP
2832
exitcode=0
2933
for test in $tests
3034
do
35+
result=$fail
3136
if ! grep -E -s -q "(cmp|diff3|sdiff)" "$test"
3237
then
33-
result=$fail
3438
sh "$test" &> /dev/null && result=$pass || exitcode=1
35-
printf "%-40s $result\n" "$test"
39+
else
40+
result=$skip
3641
fi
42+
printf " %-40s $result\n" "$test"
3743
done
3844

3945
# Clean up

0 commit comments

Comments
 (0)