Commit 121c4ae0 authored by Julien Lopez's avatar Julien Lopez

Add script to test the interface. Type "make check" in the

tests/ocaml folder to use it.
parent f0acfd04
......@@ -43,3 +43,6 @@ cdnum:
clean:
rm -f *.cmo *.cmx *.o *.cdo *.cmi a.ml c.ml cdnum eval cdsdl cdmysql *~ a
check:
./check.sh
#!/bin/sh
ROOTDIR=$HOME/cduce/cduce-ocamlinterface
TESTDIR=$ROOTDIR/tests/ocaml
TESTNOW=__testnow__
TESTREF=__testref__
ERRNOW=__testnow__
ERRREF=__testref__
TMPCDUCE=__tmpcduce__
echo -n "Building actual version..."
opam switch 4.00.0 > /dev/null 2> /dev/null
eval `opam config env`
cd $ROOTDIR/ocaml
git checkout 4.00.0 > /dev/null 2> /dev/null
cd $ROOTDIR
make clean > /dev/null 2> /dev/null
git checkout ocamlinterface > /dev/null 2> /dev/null
./configure --mliface=ocaml > /dev/null 2> /dev/null
make > /dev/null 2> /dev/null
cd $TESTDIR
make clean > /dev/null 2> /dev/null
make > $TESTNOW 2> $ERRNOW
echo "done."
echo -n "Building ref version..."
opam switch 3.12.1 > /dev/null 2> /dev/null
eval `opam config env`
cd $ROOTDIR/ocaml
git checkout 3.12.1 > /dev/null 2> /dev/null
cd $ROOTDIR
make clean > /dev/null 2> /dev/null
git checkout e9ffdf1ac5d9a57006378d96357ee28fe4b791f7 > /dev/null 2> /dev/null
./configure --mliface=ocaml > /dev/null 2> /dev/null
make > /dev/null 2> /dev/null
cd $TESTDIR
make clean > /dev/null 2> /dev/null
make > $TESTREF 2> $ERRREF
echo "done."
diff $TESTNOW $TESTREF
if [ $? -eq 0 ]; then
diff $ERRNOW $ERRREF
if [ $? -eq 0 ]; then
echo "\033[32mSuccess!\033[00m"
else
echo "\033[31mFail\033[00m"
fi
else
echo "\n\033[31mFail\033[00m"
fi
rm -f $TESTNOW $TESTREF $ERRNOW $ERRREF
git checkout ocamlinterface > /dev/null 2> /dev/null
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