Merge pull request #825 from rgrinberg/add-classical-ppx-test
Add test for classical ppx
This commit is contained in:
commit
8fea39b09b
|
@ -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"
|
||||
|
|
|
@ -492,6 +492,14 @@
|
|||
test-cases/select
|
||||
(progn (run ${exe:cram.exe} -test run.t) (diff? run.t run.t.corrected))))))
|
||||
|
||||
(alias
|
||||
((name use-meta)
|
||||
(deps ((package dune) (files_recursively_in test-cases/use-meta)))
|
||||
(action
|
||||
(chdir
|
||||
test-cases/use-meta
|
||||
(progn (run ${exe:cram.exe} -test run.t) (diff? run.t run.t.corrected))))))
|
||||
|
||||
(alias
|
||||
((name utop)
|
||||
(deps ((package dune) (files_recursively_in test-cases/utop)))
|
||||
|
@ -558,6 +566,7 @@
|
|||
(alias scope-bug)
|
||||
(alias scope-ppx-bug)
|
||||
(alias select)
|
||||
(alias use-meta)
|
||||
(alias utop)))))
|
||||
|
||||
(alias
|
||||
|
@ -609,7 +618,8 @@
|
|||
(alias redirections)
|
||||
(alias scope-bug)
|
||||
(alias scope-ppx-bug)
|
||||
(alias select)))))
|
||||
(alias select)
|
||||
(alias use-meta)))))
|
||||
|
||||
(alias ((name runtest-disabled) (deps ((alias reason)))))
|
||||
|
||||
|
|
|
@ -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)))))
|
|
@ -1,4 +1,5 @@
|
|||
(library
|
||||
((name fooppx)
|
||||
(public_name fooppx)
|
||||
(kind ppx_rewriter)
|
||||
(libraries (ocaml-migrate-parsetree))))
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
(library
|
||||
((name foobarlib)
|
||||
(public_name foobarlib)
|
||||
(libraries (str))))
|
|
@ -0,0 +1,4 @@
|
|||
open Str
|
||||
|
||||
let foo () =
|
||||
print_endline "foobarlib"
|
|
@ -0,0 +1 @@
|
|||
let () = Foobarlib.foo ()
|
|
@ -0,0 +1,2 @@
|
|||
$ dune build && dune exec -- ocamlfind opt -package foobarlib -linkpkg main.ml -o main.exe && ./main.exe
|
||||
foobarlib
|
Loading…
Reference in New Issue