Commit 61fbae77 authored by Ralf Treinen's avatar Ralf Treinen

as-installed package test

parent b5aa8be4
Tests: expr
Depends: ocaml-nox, libfindlib-ocaml, libyojson-ocaml-dev
["EAdd",["EConst",73],["EConst",42]]
#!/bin/sh -e
this=expr
indir=debian/tests
outdir=${ADT_ARTIFACTS:-/tmp}/${this}
mkdir -p ${outdir}
ppx='ppx_deriving_yojson,yojson'
cp ${indir}/${this}.ml ${indir}/expected ${outdir}
cd ${outdir}
ocamlbuild -quiet -use-ocamlfind -pkgs ${ppx} ${this}.byte
./${this}.byte > result
diff result expected
if [ -x /usr/bin/ocamlopt ]
then ocamlbuild -quiet -use-ocamlfind -pkgs ${ppx} ${this}.native;
./${this}.native > result
diff result expected
fi
type expr =
| EConst of int
| EAdd of expr * expr
[@@deriving yojson]
;;
print_endline (Yojson.Safe.to_string
(expr_to_yojson (EAdd (EConst 73, EConst 42))));;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment