Commit 7c78868c authored by Julien Lopez's avatar Julien Lopez

The interface with OCaml is now ignored from the test suite if it

has not been built, only displaying a warning.
parent c3a7aa72
......@@ -127,46 +127,57 @@ test $SUCCESS -ne $TOTAL && RET=1
# Test ocamlinterface
OCAMLDIR=$ROOT/ocaml
MAKECONF=$ROOT/../Makefile.conf
echo "Tests on ocamlinterface: "
WITHOCAML=false
test -f $MAKECONF && WITHOCAML=`cat $MAKECONF | grep ML_INTERFACE | cut -d '=' -f 2`
ocamlc -I $OCAMLDIR/misc -c $OCAMLDIR/misc/misc.mli
$ROOT/../cduce -I $OCAMLDIR/misc --compile $OCAMLDIR/misc/consts.cd
$ROOT/../cduce -I $OCAMLDIR/misc --compile $OCAMLDIR/misc/misc.cd
$ROOT/../cduce -I $OCAMLDIR/misc --mlstub $OCAMLDIR/misc/consts.cdo > $OCAMLDIR/misc/consts.ml
$ROOT/../cduce -I $OCAMLDIR/misc --mlstub $OCAMLDIR/misc/misc.cdo > $OCAMLDIR/misc/misc.ml
ocamlfind ocamlc -I $OCAMLDIR/misc -g -package cduce,oUnit -linkpkg -o $OCAMLDIR/misc/misc $OCAMLDIR/misc/consts.ml $OCAMLDIR/misc/misc.ml $OCAMLDIR/misc/misctest.ml
$OCAMLDIR/misc/misc 2> /dev/null
test $? -ne 0 && RET=1
ocamlc -I $OCAMLDIR/eval -c $OCAMLDIR/eval/eval.mli
$ROOT/../cduce -I $OCAMLDIR/eval --compile $OCAMLDIR/eval/eval.cd -I $OCAML_TOPLEVEL_PATH/../cduce
$ROOT/../cduce -I $OCAMLDIR/eval --mlstub $OCAMLDIR/eval/eval.cdo > $OCAMLDIR/eval/eval.ml
ocamlfind ocamlc -I $OCAMLDIR/eval -package cduce,oUnit -linkpkg -o $OCAMLDIR/eval/eval $OCAMLDIR/eval/eval.ml $OCAMLDIR/eval/evaltest.ml
$OCAMLDIR/eval/eval
test $? -ne 0 && RET=1
if test $WITHOCAML = "true"; then
ocamlc -I $OCAMLDIR/cdnum -c $OCAMLDIR/cdnum/cdnum.mli
$ROOT/../cduce -I $OCAMLDIR/cdnum --compile $OCAMLDIR/cdnum/cdnum.cd -I `ocamlfind query num`
$ROOT/../cduce -I $OCAMLDIR/cdnum --mlstub $OCAMLDIR/cdnum/cdnum.cdo > $OCAMLDIR/cdnum/cdnum.ml
ocamlfind ocamlc -I $OCAMLDIR/cdnum -package cduce,num,oUnit -linkpkg -o $OCAMLDIR/cdnum/cdnum $OCAMLDIR/cdnum/cdnum.ml $OCAMLDIR/cdnum/cdnumtest.ml
$OCAMLDIR/cdnum/cdnum
test $? -ne 0 && RET=1
echo "Tests on ocamlinterface: "
ocamlc -I $OCAMLDIR/misc -c $OCAMLDIR/misc/misc.mli
$ROOT/../cduce -I $OCAMLDIR/misc --compile $OCAMLDIR/misc/consts.cd
$ROOT/../cduce -I $OCAMLDIR/misc --compile $OCAMLDIR/misc/misc.cd
$ROOT/../cduce -I $OCAMLDIR/misc --mlstub $OCAMLDIR/misc/consts.cdo > $OCAMLDIR/misc/consts.ml
$ROOT/../cduce -I $OCAMLDIR/misc --mlstub $OCAMLDIR/misc/misc.cdo > $OCAMLDIR/misc/misc.ml
ocamlfind ocamlc -I $OCAMLDIR/misc -g -package cduce,oUnit -linkpkg -o $OCAMLDIR/misc/misc $OCAMLDIR/misc/consts.ml $OCAMLDIR/misc/misc.ml $OCAMLDIR/misc/misctest.ml
$OCAMLDIR/misc/misc 2> /dev/null
test $? -ne 0 && RET=1
if test $EXTENDED = "true"; then
ocamlc -I $OCAMLDIR/cdsdl -c -I `ocamlfind query sdl` $OCAMLDIR/cdsdl/cdsdl.mli
$ROOT/../cduce -I $OCAMLDIR/cdsdl --compile -I `ocamlfind query sdl` $OCAMLDIR/cdsdl/cdsdl.cd
$ROOT/../cduce -I $OCAMLDIR/cdsdl --mlstub -I `ocamlfind query sdl` $OCAMLDIR/cdsdl/cdsdl.cdo > $OCAMLDIR/cdsdl/cdsdl.ml
ocamlfind ocamlc -I $OCAMLDIR/cdsdl -package cduce,sdl,oUnit -linkpkg -o $OCAMLDIR/cdsdl/cdsdl $OCAMLDIR/cdsdl/cdsdl.ml $OCAMLDIR/cdsdl/cdsdltest.ml
$OCAMLDIR/cdsdl/cdsdl
ocamlc -I $OCAMLDIR/eval -c $OCAMLDIR/eval/eval.mli
$ROOT/../cduce -I $OCAMLDIR/eval --compile $OCAMLDIR/eval/eval.cd -I $OCAML_TOPLEVEL_PATH/../cduce
$ROOT/../cduce -I $OCAMLDIR/eval --mlstub $OCAMLDIR/eval/eval.cdo > $OCAMLDIR/eval/eval.ml
ocamlfind ocamlc -I $OCAMLDIR/eval -package cduce,oUnit -linkpkg -o $OCAMLDIR/eval/eval $OCAMLDIR/eval/eval.ml $OCAMLDIR/eval/evaltest.ml
$OCAMLDIR/eval/eval
test $? -ne 0 && RET=1
ocamlc -I $OCAMLDIR/latypes -c $OCAMLDIR/latypes/latypes.mli
$ROOT/../cduce -I $OCAMLDIR/latypes --compile $OCAMLDIR/latypes/latypes.cd
$ROOT/../cduce -I $OCAMLDIR/latypes --mlstub $OCAMLDIR/latypes/latypes.cdo > $OCAMLDIR/latypes/latypes2.ml
ocamlfind ocamlc -I $OCAMLDIR/latypes -package cduce,num,oUnit -linkpkg -o $OCAMLDIR/latypes/latypes $OCAMLDIR/latypes/latypes.ml $OCAMLDIR/latypes/latypes2.ml $OCAMLDIR/latypes/latypestest.ml
$OCAMLDIR/latypes/latypes
ocamlc -I $OCAMLDIR/cdnum -c $OCAMLDIR/cdnum/cdnum.mli
$ROOT/../cduce -I $OCAMLDIR/cdnum --compile $OCAMLDIR/cdnum/cdnum.cd -I `ocamlfind query num`
$ROOT/../cduce -I $OCAMLDIR/cdnum --mlstub $OCAMLDIR/cdnum/cdnum.cdo > $OCAMLDIR/cdnum/cdnum.ml
ocamlfind ocamlc -I $OCAMLDIR/cdnum -package cduce,num,oUnit -linkpkg -o $OCAMLDIR/cdnum/cdnum $OCAMLDIR/cdnum/cdnum.ml $OCAMLDIR/cdnum/cdnumtest.ml
$OCAMLDIR/cdnum/cdnum
test $? -ne 0 && RET=1
fi
if test $EXTENDED = "true"; then
ocamlc -I $OCAMLDIR/cdsdl -c -I `ocamlfind query sdl` $OCAMLDIR/cdsdl/cdsdl.mli
$ROOT/../cduce -I $OCAMLDIR/cdsdl --compile -I `ocamlfind query sdl` $OCAMLDIR/cdsdl/cdsdl.cd
$ROOT/../cduce -I $OCAMLDIR/cdsdl --mlstub -I `ocamlfind query sdl` $OCAMLDIR/cdsdl/cdsdl.cdo > $OCAMLDIR/cdsdl/cdsdl.ml
ocamlfind ocamlc -I $OCAMLDIR/cdsdl -package cduce,sdl,oUnit -linkpkg -o $OCAMLDIR/cdsdl/cdsdl $OCAMLDIR/cdsdl/cdsdl.ml $OCAMLDIR/cdsdl/cdsdltest.ml
$OCAMLDIR/cdsdl/cdsdl
test $? -ne 0 && RET=1
ocamlc -I $OCAMLDIR/latypes -c $OCAMLDIR/latypes/latypes.mli
$ROOT/../cduce -I $OCAMLDIR/latypes --compile $OCAMLDIR/latypes/latypes.cd
$ROOT/../cduce -I $OCAMLDIR/latypes --mlstub $OCAMLDIR/latypes/latypes.cdo > $OCAMLDIR/latypes/latypes2.ml
ocamlfind ocamlc -I $OCAMLDIR/latypes -package cduce,num,oUnit -linkpkg -o $OCAMLDIR/latypes/latypes $OCAMLDIR/latypes/latypes.ml $OCAMLDIR/latypes/latypes2.ml $OCAMLDIR/latypes/latypestest.ml
$OCAMLDIR/latypes/latypes
test $? -ne 0 && RET=1
fi
else
echo -n "Warning: The interface with OCaml isn't tested as it has not been"
echo -n " built. Check the \`mliface' option in the configure for more"
echo " information."
fi # endif $WITHOCAML = "true"
exit $RET
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