Commit 9cfd0b92 authored by Julien Lopez's avatar Julien Lopez

Minor changes and fixes in scripts

parent d653bdc6
#!/bin/sh
# Do not change these variables directly. Use options to modify the behavior of
# the script (see usage).
VERBOSE="false"
WITHOCAML="false"
OCAMLFOLDER="ocaml"
PACKAGES="pcre-ocaml ocamlnet pxp ocurl ocaml-expat"
usage ()
{
......@@ -16,6 +19,8 @@ usage ()
echo "\t-h, --help\tdisplay this help and exit"
}
# Parse options
while test $# -ge 1; do
if test $1 = "-v" || test $1 = "--verbose"; then VERBOSE="true";
elif echo $1 | grep -qse "--mliface=.*"; then
......@@ -26,6 +31,8 @@ while test $# -ge 1; do
shift;
done
# Switching opam's version of OCaml
if test $# -ge 1; then
echo -n "Switching to version $1 of OCaml..."
......@@ -41,14 +48,14 @@ if test $# -ge 1; then
echo "eval \`opam config env\`"
fi
# Installing packages
echo "Installing mandatory packages to compile CDuce."
opam install pcre-ocaml
opam install ocamlnet
opam install pxp
opam install ocurl
opam install ocaml-expat
for i in $PACKAGES; do opam install $i; done
# Checkout git repository of OCaml sources to appropriate version.
if $WITHOCAML = "true"; then
if test $WITHOCAML = "true" && test $# -ge 1; then
if test -d $OCAMLFOLDER; then
cd $OCAMLFOLDER; git checkout $1 > /dev/null 2>&1
echo "OCaml sources updated to version $1."
......
......@@ -2,25 +2,18 @@
# 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"
RET=0
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
REGDIR=$ROOT/schema/regtest
REGSCRIPT=$SCHEMADIR/test.pl
REGCDFILE=$REGDIR/test.cd
REGLOGFILE=$REGDIR/test.log
OCAMLDIR=$ROOT/ocaml
# Error code: 0 success; 1 failure.
RET=0
# Parse options
......@@ -31,6 +24,14 @@ done
# 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
......@@ -42,6 +43,11 @@ 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
......@@ -120,6 +126,8 @@ test $SUCCESS -ne $TOTAL && RET=1
# Test ocamlinterface
OCAMLDIR=$ROOT/ocaml
echo "Tests on ocamlinterface: "
ocamlc -I $OCAMLDIR/misc -c $OCAMLDIR/misc/misc.mli
......
#!/bin/sh
HOOKSDIR=$(git rev-parse --show-toplevel)/tools/git_hooks
ROOT=$(git rev-parse --show-toplevel)
HOOKSDIR=$ROOT/tools/git_hooks
HOOKS=pre-commit
GITHOOKSDIR=$(git rev-parse --show-toplevel)/.git/hooks
GITHOOKSDIR=$ROOT/.git/hooks
echo "Installing git hooks to local repository..."
for i in $HOOKS; do
......
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