From 882f25e34de08c6eaeb7f2dee0be65d9b17c0191 Mon Sep 17 00:00:00 2001 From: Andrey Popp <8mayday@gmail.com> Date: Wed, 1 May 2024 11:10:33 +0400 Subject: [PATCH] merlin: test merlin config for promoted modules Signed-off-by: Andrey Popp <8mayday@gmail.com> --- .../test-cases/merlin/granularity.t | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/blackbox-tests/test-cases/merlin/granularity.t b/test/blackbox-tests/test-cases/merlin/granularity.t index c0803bb0bc5..ec8bdb63cd1 100644 --- a/test/blackbox-tests/test-cases/merlin/granularity.t +++ b/test/blackbox-tests/test-cases/merlin/granularity.t @@ -45,6 +45,16 @@ Project sources > > (rule > (action (copy wrongext.cppo.cml wrongext.ml))) + > + > (rule + > (target generatedx.mlx) + > (mode promote) + > (action (with-stdout-to %{target} (echo "let x = \"Generatedx!\"")))) + > + > (rule + > (target generated.ml) + > (mode promote) + > (action (with-stdout-to %{target} (echo "let x = \"Generated!\"")))) > EOF $ cat >test.ml < print_endline Mel.x;; > print_endline Cppomod.x;; > print_endline Wrongext.x;; + > print_endline Generated.x;; > EOF Both Pped's ml and mli files will be preprocessed @@ -88,6 +99,7 @@ A pped file with unconventionnal filename 43 44 45 + Generated! We now query Merlin configuration for the various source files: @@ -175,3 +187,27 @@ We could expect dune to get the wrongext module configuration (?:FLG(?:-open?:Dune__exe) (?:FLG(?:-w?:@1..3@5..28@31..39@43@46..47@49..57@61..62@67@69-?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs?:-no-strict-formats?:-g) (?:SUFFIX?:.mlx .mlx)) + +We also have generated.ml and generatedx.mlx promoted: + $ ls -1 . | grep generated + generated.ml + generatedx.mlx + +It should be possible to get its merlin configuration as well: + $ ./merlin_conf.sh generated.ml + ((?:STDLIB?:/OCAMLC_WHERE + (?:EXCLUDE_QUERY_DIR + (?:B?:$TESTCASE_ROOT/_build/default/.test.eobjs/byte + (?:S?:$TESTCASE_ROOT + (?:FLG(?:-open?:Dune__exe) + (?:FLG(?:-w?:@1..3@5..28@31..39@43@46..47@49..57@61..62@67@69-?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs?:-no-strict-formats?:-g) + (?:SUFFIX?:.mlx .mlx)) + $ ./merlin_conf.sh generatedx.mlx + ((?:STDLIB?:/OCAMLC_WHERE + (?:EXCLUDE_QUERY_DIR + (?:B?:$TESTCASE_ROOT/_build/default/.test.eobjs/byte + (?:S?:$TESTCASE_ROOT + (?:FLG(?:-open?:Dune__exe) + (?:FLG(?:-w?:@1..3@5..28@31..39@43@46..47@49..57@61..62@67@69-?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs?:-no-strict-formats?:-g) + (?:SUFFIX?:.mlx .mlx + (?:READER(?:mlx)))