Update test script.

This commit is contained in:
Michael R Sweet
2026-01-11 13:46:04 -05:00
parent 6e8bd06937
commit 6fd1b781dc

View File

@@ -2,7 +2,7 @@
#
# Script to test PDFio against a directory of PDF files.
#
# Copyright © 2025 by Michael R Sweet.
# Copyright © 2025-2026 by Michael R Sweet.
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more
# information.
@@ -17,14 +17,24 @@ if test $# = 0; then
exit 1
fi
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
ac_n=-n
ac_c=
else
ac_n=
ac_c='\c'
fi
for file in $(find "$@" -name \*.pdf -print); do
# Run testpdfio to test loading the file...
echo $ac_n "\r$file$ac_c"
./testpdfio $file >$file.log 2>&1
if test $? = 0; then
# Passed
echo $ac_n "\r $ac_c"
rm -f $file.log
else
# Failed, preserve log and write filename to stdout...
echo $file
echo ""
fi
done