IronGOLEM/test.sh
2023-07-26 13:05:16 +02:00

24 lines
415 B
Bash
Executable File

tester()
{
for val in $@
do
echo $val
cat src/*.🗿 tests/$val.🗿 tests/test.🗿 >tmp.🗿
golemc tmp.🗿 > tmp.asm
orgaasm tmp.asm tmp.rom
if [ -f tests/$val.input ]
then
orgaemu tmp.rom < tests/$val.input
else
orgaemu tmp.rom
fi
echo
done
}
if [ $# -eq 0 ]
then
tester $(ls tests/*.🗿 | grep -v 'test.🗿' | sed 's/^tests\///; s/\.🗿$//' | tr '\n' ' ' );
else
tester $@;
fi