From e4c5974e38a24c72c48e78d20803b8e9e4b6c215 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Tue, 14 Feb 2023 19:49:45 -0600 Subject: [PATCH] test: top closure with mli only (#7081) Signed-off-by: Rudi Grinberg --- .../test-cases/top-closed-mli-only.t | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 test/blackbox-tests/test-cases/top-closed-mli-only.t diff --git a/test/blackbox-tests/test-cases/top-closed-mli-only.t b/test/blackbox-tests/test-cases/top-closed-mli-only.t new file mode 100644 index 00000000000..71a86a6bea2 --- /dev/null +++ b/test/blackbox-tests/test-cases/top-closed-mli-only.t @@ -0,0 +1,49 @@ +This test demonstrates a dependency being pulled via an mli only module: + + $ cat >dune-project < (lang dune 3.7) + > EOF + + $ lib=foo + + $ cat >dune < (library + > (name $lib) + > (wrapped false) + > (modules_without_implementation uast)) + > EOF + + $ cat >identifier.ml < let create () = () + > EOF + $ cat >identifier.mli < val create : unit -> unit + > EOF + + $ cat >uast.mli < module Identifier = Identifier + > EOF + + $ cat >upretty_printer.ml < let f () = Uast.Identifier.create () + > EOF + + $ mkdir bin + $ cat >bin/dune < (executable + > (name use) + > (libraries $lib)) + > EOF + + $ cat >bin/use.ml < let () = Upretty_printer.f () + > EOF + +Build in development mode: + + $ dune exec bin/use.exe + +And now in release + + $ dune exec bin/use.exe --release 2>&1 | grep -v "cd _build" + [1]