Skip to content

Commit

Permalink
Fix tests on 4.07+
Browse files Browse the repository at this point in the history
This sets the error style to short, so it should work on previous
compilers as well

Closes #263
  • Loading branch information
avsm committed Nov 24, 2019
1 parent a5aa404 commit d696925
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions ppx_cstruct.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
Expand Down
2 changes: 2 additions & 0 deletions ppx_test/errors/dune
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
1 change: 1 addition & 0 deletions ppx_test/errors/gen_tests.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 4 additions & 0 deletions ppx_test/errors/pp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()

0 comments on commit d696925

Please sign in to comment.