Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
9cfd0b92
Commit
9cfd0b92
authored
Mar 04, 2014
by
Julien Lopez
Browse files
Minor changes and fixes in scripts
parent
d653bdc6
Changes
3
Hide whitespace changes
Inline
Side-by-side
opam_config.sh
View file @
9cfd0b92
#!/bin/sh
#!/bin/sh
# Do not change these variables directly. Use options to modify the behavior of
# the script (see usage).
VERBOSE
=
"false"
VERBOSE
=
"false"
WITHOCAML
=
"false"
WITHOCAML
=
"false"
OCAMLFOLDER
=
"ocaml"
OCAMLFOLDER
=
"ocaml"
PACKAGES
=
"pcre-ocaml ocamlnet pxp ocurl ocaml-expat"
usage
()
usage
()
{
{
...
@@ -16,6 +19,8 @@ usage ()
...
@@ -16,6 +19,8 @@ usage ()
echo
"
\t
-h, --help
\t
display this help and exit"
echo
"
\t
-h, --help
\t
display this help and exit"
}
}
# Parse options
while
test
$#
-ge
1
;
do
while
test
$#
-ge
1
;
do
if
test
$1
=
"-v"
||
test
$1
=
"--verbose"
;
then
VERBOSE
=
"true"
;
if
test
$1
=
"-v"
||
test
$1
=
"--verbose"
;
then
VERBOSE
=
"true"
;
elif
echo
$1
|
grep
-qse
"--mliface=.*"
;
then
elif
echo
$1
|
grep
-qse
"--mliface=.*"
;
then
...
@@ -26,6 +31,8 @@ while test $# -ge 1; do
...
@@ -26,6 +31,8 @@ while test $# -ge 1; do
shift
;
shift
;
done
done
# Switching opam's version of OCaml
if
test
$#
-ge
1
;
then
if
test
$#
-ge
1
;
then
echo
-n
"Switching to version
$1
of OCaml..."
echo
-n
"Switching to version
$1
of OCaml..."
...
@@ -41,14 +48,14 @@ if test $# -ge 1; then
...
@@ -41,14 +48,14 @@ if test $# -ge 1; then
echo
"eval
\`
opam config env
\`
"
echo
"eval
\`
opam config env
\`
"
fi
fi
# Installing packages
echo
"Installing mandatory packages to compile CDuce."
echo
"Installing mandatory packages to compile CDuce."
opam
install
pcre-ocaml
for
i
in
$PACKAGES
;
do
opam
install
$i
;
done
opam
install
ocamlnet
opam
install
pxp
# Checkout git repository of OCaml sources to appropriate version.
opam
install
ocurl
opam
install
ocaml-expat
if
$WITHOCAML
=
"true"
;
then
if
test
$WITHOCAML
=
"true"
&&
test
$#
-ge
1
;
then
if
test
-d
$OCAMLFOLDER
;
then
if
test
-d
$OCAMLFOLDER
;
then
cd
$OCAMLFOLDER
;
git checkout
$1
>
/dev/null 2>&1
cd
$OCAMLFOLDER
;
git checkout
$1
>
/dev/null 2>&1
echo
"OCaml sources updated to version
$1
."
echo
"OCaml sources updated to version
$1
."
...
...
tests/test.sh
View file @
9cfd0b92
...
@@ -2,25 +2,18 @@
...
@@ -2,25 +2,18 @@
# Variables
# 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
`
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"
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
# Parse options
...
@@ -31,6 +24,14 @@ done
...
@@ -31,6 +24,14 @@ done
# Test schema
# 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: "
echo
-n
"Tests on schema: "
if
test
$EXTENDED
=
"false"
;
then
if
test
$EXTENDED
=
"false"
;
then
$SCHEMASCRIPT
$SCHEMACDFILE
$SCHEMALOGFILE
$SCHEMATESTS
$SCHEMASCRIPT
$SCHEMACDFILE
$SCHEMALOGFILE
$SCHEMATESTS
...
@@ -42,6 +43,11 @@ echo " passed."
...
@@ -42,6 +43,11 @@ echo " passed."
# Test regtest
# Test regtest
REGDIR
=
$ROOT
/schema/regtest
REGSCRIPT
=
$SCHEMADIR
/test.pl
REGCDFILE
=
$REGDIR
/test.cd
REGLOGFILE
=
$REGDIR
/test.log
echo
-n
"Tests on regtest: "
echo
-n
"Tests on regtest: "
$REGSCRIPT
$REGCDFILE
$REGLOGFILE
$REGDIR
/
*
.xsd
$REGSCRIPT
$REGCDFILE
$REGLOGFILE
$REGDIR
/
*
.xsd
test
$?
-ne
0
&&
RET
=
1
test
$?
-ne
0
&&
RET
=
1
...
@@ -120,6 +126,8 @@ test $SUCCESS -ne $TOTAL && RET=1
...
@@ -120,6 +126,8 @@ test $SUCCESS -ne $TOTAL && RET=1
# Test ocamlinterface
# Test ocamlinterface
OCAMLDIR
=
$ROOT
/ocaml
echo
"Tests on ocamlinterface: "
echo
"Tests on ocamlinterface: "
ocamlc
-I
$OCAMLDIR
/misc
-c
$OCAMLDIR
/misc/misc.mli
ocamlc
-I
$OCAMLDIR
/misc
-c
$OCAMLDIR
/misc/misc.mli
...
...
tools/install_hooks.sh
View file @
9cfd0b92
#!/bin/sh
#!/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
HOOKS
=
pre-commit
GITHOOKSDIR
=
$
(
git rev-parse
--show-toplevel
)
/.git/hooks
GITHOOKSDIR
=
$
ROOT
/.git/hooks
echo
"Installing git hooks to local repository..."
echo
"Installing git hooks to local repository..."
for
i
in
$HOOKS
;
do
for
i
in
$HOOKS
;
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment