summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtesting/tools/make_expected.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/testing/tools/make_expected.sh b/testing/tools/make_expected.sh
index 3d4252f0d3..793c3f5b66 100755
--- a/testing/tools/make_expected.sh
+++ b/testing/tools/make_expected.sh
@@ -5,7 +5,10 @@
# found in the LICENSE file.
#
# Script to generate expected result files.
-#
+
+# Do this before "set -e" so "which" failing is not fatal.
+PNGOPTIMIZER="$(which optipng)"
+
set -e
while (( "$#" )); do
INFILE="$1"
@@ -15,6 +18,9 @@ while (( "$#" )); do
for RESULT in $RESULTS ; do
EXPECTED=`echo -n $RESULT | sed 's/[.]pdf[.]/_expected.pdf./'`
mv $RESULT $EXPECTED
+ if [ -n "$PNGOPTIMIZER" ]; then
+ "$PNGOPTIMIZER" $EXPECTED
+ fi
done
shift
done