Updated test runner

This commit is contained in:
famfo 2022-02-13 13:46:08 +01:00
parent c3a711c3c9
commit db8afb15d5
3 changed files with 28 additions and 3 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "cif-tests"]
path = cif-tests
url = https://github.com/comes-group/cif-tests

1
cif-tests Submodule

@ -0,0 +1 @@
Subproject commit b75d28c082b4355be605e111690dca0ebf15bcca

View file

@ -1,8 +1,29 @@
#!/usr/bin/sh
for image in ../cif-tests/valid/*.cif; do
exit_code=0
echo "--- Valid tests: ---"
for image in cif-tests/valid/*.cif; do
echo "Running test on $image"
./zardzewialy-dekoder-cif $image aaa.png
echo ""
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