Commit 2fbb260f authored by POTTIER Francois's avatar POTTIER Francois

Separated test.sh into multiple scripts.

Added trustme.sh to re-generate the reference outputs.
parent ded66261
#!/bin/sh
# This script rebuilds Menhir and MenhirLib from scratch, so as to make sure
# that we are testing the current development version.
. ./config.sh
# Recompile.
rm -f $SRC/installation.ml
rm -rf $BUILD
echo "Building Menhir..."
if ! make -C $SRC >/dev/null ; then
echo "Could not build Menhir. Stop."
exit 1
fi
echo "Building MenhirLib..."
if ! make -C $SRC library >/dev/null ; then
echo "Could not build MenhirLib. Stop."
exit 1
fi
# Re-install MenhirLib.
ocamlfind remove menhirLib
ocamlfind install menhirLib $SRC/META $BUILD/menhirLib.cmi $BUILD/menhirLib.cmo $BUILD/menhirLib.cmx $BUILD/menhirLib.o
SRC=../src
BUILD=$SRC/_stage1
MENHIR=$BUILD/menhir.native
......@@ -4,27 +4,10 @@
# reference interpreter appear to be working correctly. It uses the calc
# demo for this purpose.
SRC=../src
BUILD=$SRC/_stage1
MENHIR=$BUILD/menhir.native
. ./config.sh
# Make sure Menhir is up-to-date.
rm -f $SRC/installation.ml
rm -rf $BUILD
echo "Building Menhir..."
if ! make -C $SRC >/dev/null ; then
echo "Could not build Menhir. Stop."
exit 1
fi
echo "Building MenhirLib..."
if ! make -C $SRC library >/dev/null ; then
echo "Could not build MenhirLib. Stop."
exit 1
fi
# Re-install MenhirLib.
ocamlfind remove menhirLib
ocamlfind install menhirLib $SRC/META $BUILD/menhirLib.cmi $BUILD/menhirLib.cmo $BUILD/menhirLib.cmx $BUILD/menhirLib.o
# Make sure Menhir and MenhirLib are up-to-date.
./build.sh
# Build the parser with the code back-end and run it.
echo "Building and running (code)..."
......
#!/bin/sh
# This script re-generates the reference files used by test.sh for comparison.
# One should call it only when one trusts that Menhir is currently working!
. ./config.sh
# Make sure Menhir and MenhirLib are up-to-date.
./build.sh
# Build the parser with the code back-end and run it.
echo "Building and running (code)..."
make clean >/dev/null
make MENHIR="$MENHIR --trace" >/dev/null
echo "122 + 2 * 3 + 128" | ./calc > ref.out 2> ref.err
# Run the reference interpreter.
echo "Running the reference interpreter..."
echo "INT PLUS INT TIMES INT PLUS INT EOL" | $MENHIR --trace --interpret parser.mly > interpret-ref.out 2> interpret-ref.err
echo "Done."
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment