[sledge] Build system support inline tests in all libraries

Reviewed By: mbouaziz

Differential Revision: D12854506

fbshipit-source-id: 34be9ee1f
master
Josh Berdine 6 years ago committed by Facebook Github Bot
parent 10c8b02a8d
commit 11bf7d9a39

@ -28,7 +28,7 @@ let coverage_ppx =
let ppx_flags = let ppx_flags =
match Jbuild_plugin.V1.context with "dev" -> "--debug" | _ -> "" match Jbuild_plugin.V1.context with "dev" -> "--debug" | _ -> ""
let flags deps = let flags exe_or_lib deps =
Printf.sprintf Printf.sprintf
{|(flags (%s %s)) {|(flags (%s %s))
(ocamlc_flags (%s)) (ocamlc_flags (%s))
@ -46,10 +46,12 @@ let flags deps =
ppx_sexp_value ppx_sexp_value
ppx_trace ppx_trace
%s %s
%s))|} %s))
%s|}
common_flags common_flags
(String.concat " " (String.concat " "
(List.map (fun d -> "-open " ^ String.capitalize_ascii d) deps)) (List.map (fun d -> "-open " ^ String.capitalize_ascii d) deps))
ocamlc_flags ocamlopt_flags ppx_flags coverage_ppx ocamlc_flags ocamlopt_flags ppx_flags coverage_ppx
(match exe_or_lib with `lib -> "(inline_tests)" | _ -> "")
let libraries deps = String.concat " " deps let libraries deps = String.concat " " deps

@ -24,4 +24,5 @@ Jbuild_plugin.V1.send
%s %s
(libraries cmdliner %s)) (libraries cmdliner %s))
|} |}
(flags deps) (libraries deps) (flags `exe deps)
(libraries deps)

@ -18,4 +18,5 @@ Jbuild_plugin.V1.send
%s %s
(libraries core_kernel zarith %s)) (libraries core_kernel zarith %s))
|} |}
(flags deps) (libraries deps) (flags `lib deps)
(libraries deps)

@ -18,4 +18,5 @@ Jbuild_plugin.V1.send
%s %s
(libraries ctypes ctypes.foreign llvm llvm.irreader llvm.analysis llvm.scalar_opts llvm.target %s)) (libraries ctypes ctypes.foreign llvm llvm.irreader llvm.analysis llvm.scalar_opts llvm.target %s))
|} |}
(flags deps) (libraries deps) (flags `lib deps)
(libraries deps)

@ -10,12 +10,11 @@ let deps = ["import"; "trace"; "llair_"]
;; ;;
Jbuild_plugin.V1.send Jbuild_plugin.V1.send
@@ Format.sprintf @@ Format.sprintf {|
{|
(library (library
(name symbheap) (name symbheap)
%s %s
(libraries %s) (libraries %s))
(inline_tests))
|} |}
(flags deps) (libraries deps) (flags `lib deps)
(libraries deps)

@ -18,4 +18,5 @@ Jbuild_plugin.V1.send
%s %s
(libraries %s)) (libraries %s))
|} |}
(flags deps) (libraries deps) (flags `lib deps)
(libraries deps)

Loading…
Cancel
Save