final tests

This commit is contained in:
Yaossg 2025-05-05 16:20:27 +08:00
parent a18612f583
commit a84655600d
34 changed files with 309 additions and 32 deletions

10
test.sh
View file

@ -35,17 +35,23 @@ for D in *; do
if [ -f $i.out ]; then
../boot.elf < $i.c > $i.s &&
compile $i
gcc $i.c -o $i.ref.elf 2>/dev/null
if [[ $? == 0 ]]; then
if [ -f $i.in ]; then
run_with_input $i
echo $? >> $i.ans
./$i.ref.elf < $i.in > $i.out
echo $? >> $i.out
else
run_without_input $i
echo $? >> $i.ans
./$i.ref.elf > $i.out
echo $? >> $i.out
fi
echo $? >> $i.ans
cmp $i.out $i.ans
failed=$?
if [[ $failed == 0 ]]; then
rm $i.ans $i.elf $i.s
rm $i.ans $i.elf $i.s $i.ref.elf
fi
else
failed=1