#!/bin/sh -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 .

ocamlbuild -use-ocamlfind parse_and_print.byte
./parse_and_print.byte helloworld.sh > helloworld.byte.out
diff helloworld.sh helloworld.byte.out

if [ -x /usr/bin/ocamlopt ]; then
    ocamlbuild -use-ocamlfind parse_and_print.native
    ./parse_and_print.native helloworld.sh > helloworld.native.out
    diff helloworld.sh helloworld.native.out
fi


