summaryrefslogtreecommitdiff
path: root/tests/weight
diff options
context:
space:
mode:
Diffstat (limited to 'tests/weight')
-rwxr-xr-xtests/weight22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/weight b/tests/weight
new file mode 100755
index 0000000..b5b614b
--- /dev/null
+++ b/tests/weight
@@ -0,0 +1,22 @@
+#!/bin/sh -e
+
+this=weight
+indir=debian/tests
+outdir=${ADT_ARTIFACTS:-/tmp}/${this}
+mkdir -p ${outdir}
+
+ppx='visitors.ppx,visitors.runtime'
+cp ${indir}/${this}.ml ${outdir}
+cd ${outdir}
+echo "* Compile to bytecode."
+ocamlbuild -use-ocamlfind -pkgs ${ppx} weight.byte
+echo "* Run bytecode"
+[ $(./weight.byte) -eq '16' ]
+
+if [ -x /usr/bin/ocamlopt ]
+then
+ echo "* Compile to native code"
+ ocamlbuild -use-ocamlfind -pkgs ${ppx} weight.native;
+ echo "* Run native code"
+ [ $(./weight.native) -eq '16' ]
+fi