test subdirectory
This commit is contained in:
parent
b4dbce76cf
commit
bf7f456967
32
test.sh
32
test.sh
@ -2,21 +2,27 @@ cd test
|
|||||||
gcc ../boot.c -o boot.elf
|
gcc ../boot.c -o boot.elf
|
||||||
all=0
|
all=0
|
||||||
succ=0
|
succ=0
|
||||||
for i in *.c; do
|
for D in *; do
|
||||||
all=$((all+1))
|
if [ -d "${D}" ]; then
|
||||||
i=$(basename $i .c)
|
echo "Testing subdirectory '$D'"
|
||||||
./boot.elf < $i.c > $i.s &&
|
cd $D
|
||||||
riscv64-linux-gnu-gcc-12 -static $i.s -o $i.elf &&
|
for i in *.c; do
|
||||||
qemu-riscv64 $i.elf < $i.in > $i.ans
|
all=$((all+1))
|
||||||
echo $? >> $i.ans
|
i=$(basename $i .c)
|
||||||
if cmp $i.out $i.ans; then
|
../boot.elf < $i.c > $i.s &&
|
||||||
|
riscv64-linux-gnu-gcc-12 -static $i.s -o $i.elf &&
|
||||||
|
qemu-riscv64 $i.elf < $i.in > $i.ans
|
||||||
|
echo $? >> $i.ans
|
||||||
|
if cmp $i.out $i.ans; then
|
||||||
succ=$((succ+1))
|
succ=$((succ+1))
|
||||||
echo "Test '$i' passed"
|
echo "Test '$i' passed"
|
||||||
rm $i.ans
|
rm $i.ans $i.s $i.elf
|
||||||
else
|
else
|
||||||
echo "Test '$i' failed"
|
echo "Test '$i' failed"
|
||||||
exit 1
|
fi
|
||||||
fi
|
done
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
echo "Passed $succ/$all tests"
|
echo "Passed $succ/$all tests"
|
||||||
rm *.elf
|
rm boot.elf
|
||||||
|
Loading…
Reference in New Issue
Block a user