zardzewialy-dekoder-cif/test_runner.sh

30 lines
660 B
Bash
Raw Normal View History

2022-02-13 06:14:46 -06:00
#!/usr/bin/sh
2022-02-13 06:46:08 -06:00
exit_code=0
echo "--- Valid tests: ---"
for image in cif-tests/valid/*.cif; do
2022-02-13 06:14:46 -06:00
echo "Running test on $image"
2022-02-13 06:46:08 -06:00
stderr="$(./zardzewialy-dekoder-cif $image aaa.png 2>&1 > /dev/null)"
if [[ ${#stderr} != 0 ]]; then
echo "Failed on a valid test:"
echo $stderr
exit_code=1
fi
2022-02-13 06:14:46 -06:00
done
2022-02-13 06:46:08 -06:00
echo ""
echo "--- Invalid tests: ---"
for image in cif-tests/invalid/*.cif; do
echo "Running test on $image"
stderr="$(./zardzewialy-dekoder-cif $image aaa.png 2>&1 /dev/null)"
if [[ ${#stderr} == 0 ]]; then
echo "Error: preduced an invalid image"
exit_code=1
fi
done
rm aaa.png
exit $exit_code