|
@@ -1,13 +1,14 @@
|
|
#!/bin/sh
|
|
#!/bin/sh
|
|
|
|
|
|
-# Give OCaml version as first argument
|
|
|
|
|
|
+# OCaml version is assuming to be set (for instance as system compiler) if
|
|
|
|
+# nothing is passed
|
|
|
|
|
|
# Inspired by https://github.com/ocaml/ocaml-ci-scripts
|
|
# Inspired by https://github.com/ocaml/ocaml-ci-scripts
|
|
|
|
|
|
# Use -y with evry opam command
|
|
# Use -y with evry opam command
|
|
export OPAMYES=true
|
|
export OPAMYES=true
|
|
# Installing opam
|
|
# Installing opam
|
|
-opam init --comp="$1"
|
|
|
|
|
|
+opam init --comp="${1:=system}"
|
|
eval `opam config env`
|
|
eval `opam config env`
|
|
|
|
|
|
# Versions
|
|
# Versions
|
|
@@ -20,17 +21,27 @@ echo "ocaml -version"
|
|
ocaml -version
|
|
ocaml -version
|
|
echo "============"
|
|
echo "============"
|
|
|
|
|
|
|
|
+echo "= Dependancies ="
|
|
# ocamlfind is mandatory to build
|
|
# ocamlfind is mandatory to build
|
|
opam install ocamlfind
|
|
opam install ocamlfind
|
|
-# XXX Manually install development dependancies, not yet supported (ait opam 1.3)
|
|
|
|
|
|
+# XXX Manually install development dependancies, not yet supported (wait opam 1.3)
|
|
opam install alcotest oUnit
|
|
opam install alcotest oUnit
|
|
|
|
|
|
# Installing dependancies and testing installation
|
|
# Installing dependancies and testing installation
|
|
opam pin add oclaunch-ci .
|
|
opam pin add oclaunch-ci .
|
|
-# Building OcLaunch and running tests
|
|
|
|
-./configure --enable-tests
|
|
|
|
-make test
|
|
|
|
|
|
+echo "============"
|
|
|
|
+
|
|
|
|
+# Run test if OC_NOTEST is false
|
|
|
|
+if [ ! ${OC_NOTEST} ]; then
|
|
|
|
+ # Build OcLaunch only
|
|
|
|
+ ./configure
|
|
|
|
+ make
|
|
|
|
+else
|
|
|
|
+ # Building OcLaunch and running tests
|
|
|
|
+ ./configure --enable-tests
|
|
|
|
+ make test
|
|
|
|
|
|
-# Test the produced binary
|
|
|
|
-oclaunch -version
|
|
|
|
-echo "En" | oclaunch
|
|
|
|
|
|
+ # Test the produced binary
|
|
|
|
+ oclaunch -version
|
|
|
|
+ echo "En" | oclaunch
|
|
|
|
+fi
|