Skip to content

Commit

Permalink
Checker script checks the equality of output
Browse files Browse the repository at this point in the history
  • Loading branch information
koba-e964 committed Nov 25, 2019
1 parent 785788d commit 28f4382
Showing 1 changed file with 28 additions and 14 deletions.
42 changes: 28 additions & 14 deletions check-test-mls.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
success=0
total=0

ARCH=${ARCH:-x86}

NECESSARY_FILES="assets/stub.c assets/${ARCH}/libmincaml.S"

if cargo build --release; then
for i in test/*.ml; do
echo "---- ${i} ----"
cat ${i}
if cargo run --release -q -- ${i} ${i}.asm >/dev/null; then
echo "[OK] $i"
cat ${i}.asm
echo; echo
success=`expr $success + 1`
else
echo "[Error] $i"
fi
total=`expr $total + 1`
done
echo "Success rate: $success/$total"
for i in test/*.ml; do
echo "---- ${i} ----"
if cargo run --release -q -- ${i} ${i}.asm >/dev/null 2>&1; then
if cc ${i}.asm ${NECESSARY_FILES} -o ${i}.x; then
if ./${i}.x >${i}.out; then
# testrun ml
ocaml ${i} >${i}.ans
if diff ${i}.out ${i}.ans; then
echo "[OK] $i"
success=$((success+1))
else
echo "[Output Error] ${i}"
fi
fi
else
echo "[Link Error] $i"
fi
else
echo "[Compile Error] $i"
fi
total=$((total+1))
done
echo "Success rate: $success/$total"
else
echo "build error"
exit 1
Expand Down

0 comments on commit 28f4382

Please sign in to comment.