diff --git a/CHANGES.md b/CHANGES.md index 4b5a1bfe..b7d4de2b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -28,6 +28,9 @@ next - Add support for setting the default ocaml flags and for build profiles (#419, @diml) +- Display a better error messages when writing `(inline_tests)` in an + executable stanza (#748, @diml) + 1.0+beta20 (10/04/2018) ----------------------- diff --git a/src/jbuild.ml b/src/jbuild.ml index 3fbec75b..3c933305 100644 --- a/src/jbuild.ml +++ b/src/jbuild.ml @@ -890,6 +890,15 @@ module Executables = struct field_oslu "link_flags" >>= fun link_flags -> field "modes" Link_mode.Set.t ~default:Link_mode.Set.default >>= fun modes -> + map_validate + (field "inline_tests" (fun _ -> true) ~default:false ~short:(This true)) + ~f:(function + | false -> Ok () + | true -> + Error + "Inline tests are only allowed in libraries.\n\ + See https://github.com/ocaml/dune/issues/745 for more details.") + >>= fun () -> let t = { names ; link_executables