Commit 9010aa75 authored by Kim Nguyễn's avatar Kim Nguyễn

Cleanup the Makefile and remove ununsed shell script.

parent 6b733b5a
...@@ -16,8 +16,6 @@ ifneq ($(ML_INTERFACE), false) ...@@ -16,8 +16,6 @@ ifneq ($(ML_INTERFACE), false)
INSTALL_BINARIES += cduce_mktop INSTALL_BINARIES += cduce_mktop
endif endif
OUNIT_TESTS=eval cdnum cdsdl misc
ifeq ($(NATIVE),true) ifeq ($(NATIVE),true)
ALL_TARGET += cduce_lib.cmxa ALL_TARGET += cduce_lib.cmxa
endif endif
...@@ -319,29 +317,29 @@ compute_depend: $(DEPEND_OCAMLDEP) ...@@ -319,29 +317,29 @@ compute_depend: $(DEPEND_OCAMLDEP)
done done
clean: clean:
for i in $(CLEAN_DIRS); do \ @echo "Clean"
(cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *.a *.cmxa *.cmt *.cmti *~); \ $(HIDE) for i in $(CLEAN_DIRS); do \
(cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *.a *.cmxa *.cmt *.cmti *~); \
done done
rm -f misc/q_symbol.cmo.stamp $(HIDE) rm -f misc/q_symbol.cmo.stamp
test -n "$(OCAMLIFACE)" && (cd $(OCAMLIFACE); $(MAKE) clean) || true $(HIDE) test -n "$(OCAMLIFACE)" && (cd $(OCAMLIFACE); $(MAKE) clean) || true
rm -f `find . -name "*~"` $(HIDE) rm -f `find . -name "*~"`
rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.cmt *.cmti *.o *~ META $(HIDE) rm -f *.cmi *.cmo *.cma *.cmx *.a *.cmxa *.cmt *.cmti *.o *~ META
rm -f cduce$(EXE) ocamlprof.dump $(HIDE) rm -f cduce$(EXE) ocamlprof.dump
rm -f dtd2cduce$(EXE) webiface$(EXE) evaluator$(EXE) $(HIDE) rm -f dtd2cduce$(EXE) webiface$(EXE) evaluator$(EXE)
rm -Rf prepro package $(HIDE) rm -Rf prepro package
rm -f web/www/*.html web/*~ $(HIDE) rm -f web/www/*.html web/*~
rm -f web/*.cdo $(HIDE) rm -f web/*.cdo
rm -f configure.log $(HIDE) rm -f configure.log
rm -rf web/doc $(HIDE) rm -rf web/doc
rm -f META $(HIDE) rm -f META
rm -rf lib $(HIDE) rm -rf lib
$(RM) tests/schema/regtest/test.cd tests/schema/regtest/test.log $(HIDE) rm -f tests/schema/regtest/test.cd tests/schema/regtest/test.log
$(RM) tests/schema/test.cd tests/schema/test.log tests/misc/log tests/misc/memento.html tests/xsltmark/log tests/cql/log $(HIDE) rm -f tests/schema/test.cd tests/schema/test.log tests/misc/log tests/misc/memento.html tests/xsltmark/log tests/cql/log
$(RM) oUnit-* tests/ocaml/misc/consts.ml tests/ocaml/misc/consts.cdo tests/ocaml/misc/consts.cmi tests/ocaml/misc/consts.cmo tests/ocaml/latypes/latypes2* tests/ocaml/latypes/latypes tests/ocaml/latypes/latypes.c[dm][oxi] tests/ocaml/latypes/latypestest.cm[io]
for i in $(OUNIT_TESTS); do $(RM) `echo tests/ocaml/$$i/$$i tests/ocaml/$$i/$$i.ml tests/ocaml/$$i/$$i.c[dm][oxi] tests/ocaml/$$i/$${i}test.cm[io]`; done
distclean: clean distclean: clean
rm -f Makefile.conf @echo "Distclean"
$(HIDE) rm -f Makefile.conf
.SUFFIXES: .ml .mli .cmo .cmi .cmx .SUFFIXES: .ml .mli .cmo .cmi .cmx
......
#!/bin/sh
# Variables
# Path from caller to script. TODO: Some tests won't work if the script is
# called from another place than the root directory of the project.
ROOT=`dirname $0`
# false: normal test suite (default), true: extended test suite. Do not modify
# this variable directly. To run the extended test suite, use the "-e" option.
# The extended test suite contains the normal test suite plus broken tests to
# fix and tests on features that are not supported by CDuce (yet).
EXTENDED="false"
# Error code: 0 success; 1 failure.
RET=0
CDUCE="$ROOT/../cduce"
# Parse options
while test $# -ne 0; do
if test $1 = "-e" || test $1 = "--extended"; then EXTENDED="true"; fi;
shift;
done
# Test stdlib
STDLIBDIR=$ROOT/stdlib
echo -n "Tests on stdlib: "
$CDUCE $ROOT/stdlib/list/listtest.cd 2> /dev/null
test $? -ne 0 && RET=1
echo " passed."
# Test schema
SCHEMADIR=$ROOT/schema
SCHEMATESTS="$SCHEMADIR/library1.xsd $SCHEMADIR/library2.xsd\
$SCHEMADIR/library3.xsd $SCHEMADIR/mails.xsd $SCHEMADIR/po.xsd\
$SCHEMADIR/po2.xsd"
SCHEMASCRIPT=$SCHEMADIR/test.pl
SCHEMACDFILE=$SCHEMADIR/test.cd
SCHEMALOGFILE=$SCHEMADIR/test.log
echo -n "Tests on schema: "
if test $EXTENDED = "false"; then
$SCHEMASCRIPT $SCHEMACDFILE $SCHEMALOGFILE $SCHEMATESTS
else
$SCHEMASCRIPT $SCHEMACDFILE $SCHEMALOGFILE $SCHEMADIR/*.xsd
fi
test $? -ne 0 && RET=1
echo " passed."
# Test regtest
REGDIR=$ROOT/schema/regtest
REGSCRIPT=$SCHEMADIR/test.pl
REGCDFILE=$REGDIR/test.cd
REGLOGFILE=$REGDIR/test.log
echo -n "Tests on regtest: "
$REGSCRIPT $REGCDFILE $REGLOGFILE $REGDIR/*.xsd
test $? -ne 0 && RET=1
echo " passed."
# Test xsltmark
SUCCESS=0
TOTAL=0
XSLTLOG=$ROOT/xsltmark/log
GOODTESTS="$ROOT/xsltmark/identity.cd"
EXTENDEDTESTS="$ROOT/xsltmark/xslbench2.cd $ROOT/xsltmark/xslbench4.cd"
echo -n "Tests on xsltmark: "
echo > $XSLTLOG
if test $EXTENDED = "true"; then GOODTESTS="$GOODTESTS $EXTENDEDTESTS"; fi
for i in db100.xml db10.xml; do
TOTAL=$(($TOTAL+1))
echo "==============dbonerow.cd --arg $i===============" >> $XSLTLOG;
$CDUCE $ROOT/xsltmark/dbonerow.cd --arg $ROOT/xsltmark/testcases/$i > /dev/null 2>> $XSLTLOG;
if test $? -eq 0; then SUCCESS=$(($SUCCESS+1)); fi
done
for i in $GOODTESTS; do
TOTAL=$(($TOTAL+1))
echo "==============`echo $i | rev | cut -d "/" -f -1 | rev`===============" >> $XSLTLOG;
$CDUCE $i > /dev/null 2>> $XSLTLOG;
if test $? -eq 0; then SUCCESS=$(($SUCCESS+1)); fi
done
echo "$SUCCESS / $TOTAL passed."
test $SUCCESS -ne $TOTAL && RET=1
# Test cql
SUCCESS=0
TOTAL=0
CQLLOG=$ROOT/cql/log
GOODTESTS="$ROOT/cql/TREE/* $ROOT/cql/XMP/*"
EXTENDEDTESTS="$ROOT/cql/R/* $ROOT/cql/SEQ/*"
echo -n "Tests on cql: "
echo > $CQLLOG
if test $EXTENDED = "true"; then GOODTESTS="$GOODTESTS $EXTENDEDTESTS"; fi
for i in $GOODTESTS; do
TOTAL=$(($TOTAL+1))
echo "==============`echo $i | rev | cut -d "/" -f -1 | rev`===============" >> $CQLLOG;
$CDUCE $i > /dev/null 2>> $CQLLOG;
if test $? -eq 0; then SUCCESS=$(($SUCCESS+1)); fi
done
echo "$SUCCESS / $TOTAL passed."
test $SUCCESS -ne $TOTAL && RET=1
# Test misc
echo -n "Tests on misc: "
SUCCESS=0
TOTAL=0
MISCLOG=$ROOT/misc/log
GOODTESTS="$ROOT/misc/addrbook.cd $ROOT/misc/biblio.cd\
$ROOT/misc/fixml4.3v20020920.cd $ROOT/misc/funs.cd $ROOT/misc/IFX130.cd\
$ROOT/misc/integers.cd $ROOT/misc/lazy.cd $ROOT/misc/mc.cd\
$ROOT/misc/memento.cd $ROOT/misc/notes.cd $ROOT/misc/ns.cd\
$ROOT/misc/overloading.cd $ROOT/misc/overloading2.cd $ROOT/misc/patterns.cd\
$ROOT/misc/security.cd $ROOT/misc/str.cd $ROOT/misc/stress_opt_arg.cd\
$ROOT/misc/stress_opt_seq.cd $ROOT/misc/vouill.cd $ROOT/misc/web.cd\
$ROOT/misc/wp.cd $ROOT/misc/xtrans.cd $ROOT/misc/ref.cd $ROOT/misc/xhtml.cd\
$ROOT/misc/polysyntax.cd $ROOT/misc/polyfuns.cd"
BADTESTS="$ROOT/misc/bugs_prod.cd $ROOT/misc/eval_concat.cd"
EXTENDEDTESTS="$ROOT/misc/html2latex.cd"
echo > $MISCLOG
if test $EXTENDED = "true"; then GOODTESTS="$GOODTESTS $EXTENDEDTESTS"; fi
for i in $GOODTESTS; do
TOTAL=$(($TOTAL+1))
echo "==============`echo $i | rev | cut -d "/" -f -1 | rev`===============" >> $MISCLOG;
$CDUCE $i > /dev/null 2>> $MISCLOG;
if test $? -eq 0; then SUCCESS=$(($SUCCESS+1)); fi
done
for i in $BADTESTS; do
TOTAL=$(($TOTAL+1))
echo "==============`echo $i | rev | cut -d "/" -f -1 | rev`===============" >> $MISCLOG;
$CDUCE $i > /dev/null 2>> $MISCLOG;
if test $? -ne 0; then SUCCESS=$(($SUCCESS+1)); fi
done
echo "$SUCCESS / $TOTAL passed."
test $SUCCESS -ne $TOTAL && RET=1
# Test ocamlinterface
OCAMLDIR=$ROOT/ocaml
MAKECONF=$ROOT/../Makefile.conf
WITHOCAML=false
test -f $MAKECONF && WITHOCAML=`cat $MAKECONF | grep "ML_INTERFACE=" | cut -d '=' -f 2`
if test $WITHOCAML = "true"; then
echo "Tests on ocamlinterface: "
ocamlc -I $OCAMLDIR/misc -c $OCAMLDIR/misc/misc.mli
$CDUCE -I $OCAMLDIR/misc --compile $OCAMLDIR/misc/consts.cd
$CDUCE -I $OCAMLDIR/misc --compile $OCAMLDIR/misc/misc.cd
$CDUCE -I $OCAMLDIR/misc --mlstub $OCAMLDIR/misc/consts.cdo > $OCAMLDIR/misc/consts.ml
$CDUCE -I $OCAMLDIR/misc --mlstub $OCAMLDIR/misc/misc.cdo > $OCAMLDIR/misc/misc.ml
ocamlfind ocamlc -I $OCAMLDIR/misc -g -package expat,pxp,curl,camlp4.lib,oUnit,num,netstring,pcre,ulex,oUnit -linkpkg -I lib lib/cduce_lib.cma -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
$CDUCE -I $OCAMLDIR/eval --compile $OCAMLDIR/eval/eval.cd -I $ROOT/../lib
$CDUCE -I $OCAMLDIR/eval --mlstub $OCAMLDIR/eval/eval.cdo > $OCAMLDIR/eval/eval.ml
ocamlfind ocamlc -I $OCAMLDIR/eval -package expat,pxp,curl,camlp4.lib,oUnit,num,netstring,pcre,ulex,oUnit -linkpkg -I lib lib/cduce_lib.cma -o $OCAMLDIR/eval/eval $OCAMLDIR/eval/eval.ml $OCAMLDIR/eval/evaltest.ml
$OCAMLDIR/eval/eval
test $? -ne 0 && RET=1
ocamlc -I $OCAMLDIR/cdnum -c $OCAMLDIR/cdnum/cdnum.mli
$CDUCE -I $OCAMLDIR/cdnum --compile $OCAMLDIR/cdnum/cdnum.cd -I `ocamlfind query num`
$CDUCE -I $OCAMLDIR/cdnum --mlstub $OCAMLDIR/cdnum/cdnum.cdo > $OCAMLDIR/cdnum/cdnum.ml
ocamlfind ocamlc -I $OCAMLDIR/cdnum -package expat,pxp,curl,camlp4.lib,oUnit,num,netstring,pcre,ulex,num,oUnit -linkpkg -I lib lib/cduce_lib.cma -o $OCAMLDIR/cdnum/cdnum $OCAMLDIR/cdnum/cdnum.ml $OCAMLDIR/cdnum/cdnumtest.ml
$OCAMLDIR/cdnum/cdnum
test $? -ne 0 && RET=1
if test $EXTENDED = "true"; then
ocamlc -I $OCAMLDIR/cdsdl -c -I `ocamlfind query sdl` $OCAMLDIR/cdsdl/cdsdl.mli
$CDUCE -I $OCAMLDIR/cdsdl --compile -I `ocamlfind query sdl` $OCAMLDIR/cdsdl/cdsdl.cd
$CDUCE -I $OCAMLDIR/cdsdl --mlstub -I `ocamlfind query sdl` $OCAMLDIR/cdsdl/cdsdl.cdo > $OCAMLDIR/cdsdl/cdsdl.ml
ocamlfind ocamlc -I $OCAMLDIR/cdsdl -package expat,pxp,curl,camlp4.lib,oUnit,num,netstring,pcre,ulex,sdl,oUnit -linkpkg -I lib lib/cduce_lib.cma -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
$CDUCE -I $OCAMLDIR/latypes --compile $OCAMLDIR/latypes/latypes.cd
$CDUCE -I $OCAMLDIR/latypes --mlstub $OCAMLDIR/latypes/latypes.cdo > $OCAMLDIR/latypes/latypes2.ml
ocamlfind ocamlc -I $OCAMLDIR/latypes -package expat,pxp,curl,camlp4.lib,oUnit,num,netstring,pcre,ulex,num,oUnit -linkpkg -I lib lib/cduce_lib.cma -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