unit test
This commit is contained in:
parent
98d5a1a3bc
commit
54db58d362
18 changed files with 64 additions and 9 deletions
20
test.sh
Normal file
20
test.sh
Normal file
|
@ -0,0 +1,20 @@
|
|||
cd test
|
||||
gcc ../boot.c
|
||||
all=0
|
||||
succ=0
|
||||
for i in *.c; do
|
||||
all=$((all+1))
|
||||
i=$(basename $i .c)
|
||||
./a.out < $i.c > $i.s &&
|
||||
riscv64-linux-gnu-gcc-12 -static $i.s -o $i.c.out &&
|
||||
qemu-riscv64 $i.c.out < $i.in > $i.ans
|
||||
echo $? >> $i.ans
|
||||
if cmp $i.out $i.ans; then
|
||||
succ=$((succ+1))
|
||||
echo "Test '$i' passed"
|
||||
else
|
||||
echo "Test '$i' failed"
|
||||
fi
|
||||
done
|
||||
echo "Passed $succ/$all tests"
|
||||
rm *.c.out *.s *.ans a.out
|
Loading…
Add table
Add a link
Reference in a new issue