30 lines
660 B
Bash
Executable file
30 lines
660 B
Bash
Executable file
#!/usr/bin/sh
|
|
|
|
exit_code=0
|
|
|
|
echo "--- Valid tests: ---"
|
|
for image in cif-tests/valid/*.cif; do
|
|
echo "Running test on $image"
|
|
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
|
|
done
|
|
|
|
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
|
|
|