Add test for classical ppx

Test that generated META can be used by ocamlfind

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
Rudi Grinberg 2018-05-30 14:58:03 +07:00
parent 62edd42d8a
commit 939341af16
5 changed files with 7 additions and 4 deletions

View File

@ -46,7 +46,7 @@ case "$TARGET" in
rm -rf ~/.opam
opam init --yes
eval $(opam config env)
opam install utop ppx_driver odoc menhir ocaml-migrate-parsetree js_of_ocaml-ppx js_of_ocaml-compiler--yes
opam install ocamlfind utop ppx_driver odoc menhir ocaml-migrate-parsetree js_of_ocaml-ppx js_of_ocaml-compiler--yes
opam remove jbuilder `opam list --depends-on jbuilder --installed --short` --yes
if opam info dune &> /dev/null; then
opam remove dune `opam list --depends-on dune --installed --short` --yes
@ -82,7 +82,7 @@ case "$TARGET" in
echo "depends: [\"dune\"]" >> jbuilder.opam
opam pin add dune . --no-action --yes
opam pin add jbuilder . --no-action --yes
opam install utop ppx_driver odoc ocaml-migrate-parsetree js_of_ocaml-ppx js_of_ocaml-compiler --yes
opam install ocamlfind utop ppx_driver odoc ocaml-migrate-parsetree js_of_ocaml-ppx js_of_ocaml-compiler --yes
echo -en "travis_fold:end:opam.deps\r"
fi
echo -en "travis_fold:start:dune.bootstrap\r"

View File

@ -13,4 +13,4 @@
(executable
((name w_ppx_driver_flags)
(modules (w_ppx_driver_flags))
(preprocess (pps (fooppx -flag (-arg omp) ppx_driver.runner)))))
(preprocess (pps (fooppx -flag (-arg omp) ppx_driver.runner)))))

View File

@ -1,4 +1,5 @@
(library
((name fooppx)
(public_name fooppx)
(kind ppx_rewriter)
(libraries (ocaml-migrate-parsetree))))

View File

@ -3,7 +3,7 @@
ocamlc ppx/.fooppx.objs/fooppx.{cmi,cmo,cmt}
ocamlopt ppx/.fooppx.objs/fooppx.{cmx,o}
ocamlopt ppx/fooppx.{a,cmxa}
ocamlopt .ppx/fooppx@./ppx.exe
ocamlopt .ppx/fooppx/ppx.exe
ppx w_omp_driver.pp.ml
ocamldep w_omp_driver.pp.ml.d
ocamlc .w_omp_driver.eobjs/w_omp_driver.{cmi,cmo,cmt}
@ -18,3 +18,5 @@
ocamlopt w_ppx_driver.exe
This test is broken because ppx_driver doesn't support migrate custom arguments
# $ dune build ./w_ppx_driver_flags.exe --display short
$ dune build && dune exec -- ocamlfind opt -package fooppx -ppxopt "fooppx,-flag" -linkpkg w_omp_driver.ml -o w_omp_driver.exe
pass -arg to fooppx