summaryrefslogtreecommitdiff
path: root/debian/tests/api-ocaml
diff options
context:
space:
mode:
Diffstat (limited to 'debian/tests/api-ocaml')
-rwxr-xr-xdebian/tests/api-ocaml25
1 files changed, 25 insertions, 0 deletions
diff --git a/debian/tests/api-ocaml b/debian/tests/api-ocaml
new file mode 100755
index 0000000..b458604
--- /dev/null
+++ b/debian/tests/api-ocaml
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e
+
+indir=${PWD}/debian/tests
+outdir=${ADT_ARTIFACTS-/tmp/morsmall-package-test}/ocaml-api
+mkdir -p ${outdir}
+cd ${outdir}
+cp ${indir}/parse_and_print.ml ${indir}/_tags ${indir}/helloworld.sh .
+
+echo "* Compile to bytecode."
+ocamlbuild -use-ocamlfind parse_and_print.byte
+echo "* Run the bytecode."
+./parse_and_print.byte helloworld.sh > helloworld.byte.out
+diff helloworld.sh helloworld.byte.out
+
+if [ -x /usr/bin/ocamlopt ]; then
+ echo "* Compile to native code."
+ ocamlbuild -use-ocamlfind parse_and_print.native
+ echo "* Run the native code."
+ ./parse_and_print.native helloworld.sh > helloworld.native.out
+ diff helloworld.sh helloworld.native.out
+fi
+
+