python-obja/test.sh

31 lines
581 B
Bash
Raw Normal View History

2020-12-07 17:57:45 +01:00
#!/usr/bin/env bash
return_code=0
for file in tests/*.obja; do
echo -n "Testing $file... "
./obja.py $file > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo -e '\033[32mSUCCESS\033[0m'
else
echo -e '\033[31mFAILURE\033[0m'
return_code=1
fi
done
# objb files should fail
for file in tests/*.objb; do
echo -n "Testing $file... "
./obja.py $file > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo -e '\033[31mFAILURE\033[0m'
return_code=1
else
echo -e '\033[32mSUCCESS\033[0m'
fi
done
exit $return_code