Add some reason tests wrt to ppx preprocessing (#375)

Add some reason tests wrt to ppx preprocessing
This commit is contained in:
Rudi Grinberg 2017-12-19 19:49:06 +08:00 committed by GitHub
parent 2f8d95cdeb
commit 3cae475486
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 1 deletions

View File

@ -7,7 +7,10 @@
((name rlib)
(public_name rlib)
(preprocess
(per_module ((action (run ./pp/reasononlypp.exe ${<})) (cppome))))))
(per_module
((pps (reasonppx)) (foo))
((pps (reasonppx (-lint false))) (hello))
((action (run ./pp/reasononlypp.exe ${<})) (cppome))))))
;; we want to make sure that .rei files are present
(alias

View File

@ -0,0 +1,7 @@
(jbuild_version 1)
(library
((name reasonppx)
(wrapped false)
(kind ppx_rewriter)
(libraries (ocaml-migrate-parsetree))))

View File

@ -0,0 +1,14 @@
let lint = ref false
let () =
Migrate_parsetree.Driver.register
~name:"reasonppx"
~args:(["-lint", Arg.Bool (fun l -> lint := l), ""])
Migrate_parsetree.Versions.ocaml_405
(fun _ _cookies ->
if !lint then (
exit 0
) else (
Migrate_parsetree.Ast_405.shallow_identity
)
)

View File

@ -1,6 +1,7 @@
$ $JBUILDER runtest -j1 --root .
refmt bar.re.ml
ocamldep pp/reasononlypp.depends.ocamldep-output
ocamldep ppx/reasonppx.depends.ocamldep-output
refmt hello.re.ml
refmt pped.re.ml
ocamlc rlib.{cmi,cmo,cmt}
@ -8,13 +9,21 @@
refmt hello.re.mli
refmt pped.re.mli
ocamlc pp/reasononlypp.{cmi,cmo,cmt}
ocamlc ppx/reasonppx.{cmi,cmo,cmt}
ocamlopt rlib.{cmx,o}
ocamlopt pp/reasononlypp.{cmx,o}
ocamlopt ppx/reasonppx.{cmx,o}
ocamlopt pp/reasononlypp.exe
ocamlopt ppx/reasonppx.{a,cmxa}
reasononlypp cppome.pp.re
reasononlypp cppome.pp.rei
ocamlopt .ppx/reasonppx/ppx.exe
refmt cppome.pp.re.ml
refmt cppome.pp.re.mli
ppx foo.pp.ml
ppx hello.re.pp.ml
ppx foo.re.pp.mli
ppx hello.re.pp.mli
ocamldep rlib.depends.ocamldep-output
ocamldep rlib.dependsi.ocamldep-output
ocamlc rlib__Bar.{cmi,cmti}