Skip to content

Commit

Permalink
Allow running a subset of tests by setting the TESTS environment vari…
Browse files Browse the repository at this point in the history
…able
  • Loading branch information
oSoMoN committed Feb 12, 2024
1 parent 143359d commit 149c044
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions run-upstream-testsuite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,14 @@ cd src
ln -s "$binary" diff
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)
if [[ -n "$TESTS" ]]
then
tests="$TESTS"
else
# Get a list of all upstream tests (default if $TESTS isn't set)
echo -e '\n\nprinttests:\n\t@echo "${TESTS}"' >> Makefile.am
tests=$(make -f Makefile.am printtests)
fi
echo "Running $(echo "$tests" | wc -w) tests"
export LC_ALL=C
pass="$(tput setaf 2)PASS$(tput sgr0)"
Expand All @@ -45,6 +50,7 @@ exitcode=0
for test in $tests
do
result=$fail
# Run only the tests that invoke `diff`, because other binaries aren't implemented yet
if ! grep -E -s -q "(cmp|diff3|sdiff)" "$test"
then
sh "$test" &> /dev/null && result=$pass || exitcode=1
Expand Down

0 comments on commit 149c044

Please sign in to comment.