diff --git a/ppx_cstruct.opam b/ppx_cstruct.opam index 27502c3e..131d23f8 100644 --- a/ppx_cstruct.opam +++ b/ppx_cstruct.opam @@ -25,6 +25,7 @@ depends: [ "ppx_sexp_conv" {with-test} "sexplib" {>="v0.9.0"} "cstruct-sexp" {with-test} + "cppo" {with-test} "cstruct-unix" {with-test & =version} "stdlib-shims" ] diff --git a/ppx_test/errors/dune b/ppx_test/errors/dune index 7a0eb551..92314158 100644 --- a/ppx_test/errors/dune +++ b/ppx_test/errors/dune @@ -1,6 +1,8 @@ (executable (name pp) (modules pp) + (preprocess (action + (run %{bin:cppo} -V OCAML:%{ocaml_version} %{input-file}))) (libraries ppx_cstruct ocaml-migrate-parsetree)) diff --git a/ppx_test/errors/gen_tests.ml b/ppx_test/errors/gen_tests.ml index 65979bfe..ae972b6e 100644 --- a/ppx_test/errors/gen_tests.ml +++ b/ppx_test/errors/gen_tests.ml @@ -19,6 +19,7 @@ let output_stanzas name = let is_test = function | "pp.ml" -> false + | "pp.pp.ml" -> false | "gen_tests.ml" -> false | e -> Filename.check_suffix e ".ml" diff --git a/ppx_test/errors/pp.ml b/ppx_test/errors/pp.ml index b1c1c38c..4752df42 100644 --- a/ppx_test/errors/pp.ml +++ b/ppx_test/errors/pp.ml @@ -3,4 +3,8 @@ external sys_exit : int -> 'a = "caml_sys_exit" let () = at_exit (fun () -> sys_exit 0) +#if OCAML_VERSION >= (4,7,0) +let () = Clflags.(error_style := Some Short) +#endif + let () = Migrate_parsetree.Driver.run_main ()