#!/bin/sh

set -eux

./pngfix pngtest.png &> log.txt  2>&1

if grep -i "OK" log.txt 2>&1 ; then
   echo "PASS: pngfix passed"
else
   echo "FAIL: pngfix failed"
fi
rm -f log.txt

./pngtest pngtest.png &> log.txt 2>&1

if grep -i "PASS" log.txt 2>&1 ; then
   echo "PASS: pngtest passed"
else
   echo "FAIL: pngtest failed"
fi
rm -f log.txt

for i in pngstest timepng; do
    if "./${i}" pngtest.png 2>&1; then
        echo "PASS: $i"
    else
        echo "FAIL: $i"
    fi
done
