| 1 |
$ ocamlc_where="$(ocamlc -where)" |
| 2 |
$ export BUILD_PATH_PREFIX_MAP="/OCAMLC_WHERE=$ocamlc_where:$BUILD_PATH_PREFIX_MAP" |
| 3 |
|
| 4 |
We build the project |
| 5 |
$ dune exec ./test.exe |
| 6 |
bar |
| 7 |
|
| 8 |
Verify that merlin configuration was generated... |
| 9 |
$ dune ocaml merlin dump-config --format=json $PWD | jq -r ' |
| 10 |
> include "dune"; |
| 11 |
> .[] |
| 12 |
> | merlinJsonEntry' |
| 13 |
Test: _build/default/test |
| 14 |
["INDEX","$TESTCASE_ROOT/_build/default/.test.eobjs/cctx.ocaml-index"] |
| 15 |
["INDEX","$TESTCASE_ROOT/_build/default/.foo.objs/cctx.ocaml-index"] |
| 16 |
["STDLIB","/OCAMLC_WHERE"] |
| 17 |
["SOURCE_ROOT","$TESTCASE_ROOT"] |
| 18 |
["EXCLUDE_QUERY_DIR"] |
| 19 |
["B","$TESTCASE_ROOT/_build/default/.foo.objs/byte"] |
| 20 |
["B","$TESTCASE_ROOT/_build/default/.test.eobjs/byte"] |
| 21 |
["S","$TESTCASE_ROOT"] |
| 22 |
["S","$TESTCASE_ROOT/411"] |
| 23 |
["FLG",["-w","@[email protected]@30..39@[email protected]@[email protected]","-strict-sequence","-strict-formats","-short-paths","-keep-locs","-g"]] |
| 24 |
["UNIT_NAME","dune__exe__Test"] |
| 25 |
Test: _build/default/test.ml |
| 26 |
["INDEX","$TESTCASE_ROOT/_build/default/.test.eobjs/cctx.ocaml-index"] |
| 27 |
["INDEX","$TESTCASE_ROOT/_build/default/.foo.objs/cctx.ocaml-index"] |
| 28 |
["STDLIB","/OCAMLC_WHERE"] |
| 29 |
["SOURCE_ROOT","$TESTCASE_ROOT"] |
| 30 |
["EXCLUDE_QUERY_DIR"] |
| 31 |
["B","$TESTCASE_ROOT/_build/default/.foo.objs/byte"] |
| 32 |
["B","$TESTCASE_ROOT/_build/default/.test.eobjs/byte"] |
| 33 |
["S","$TESTCASE_ROOT"] |
| 34 |
["S","$TESTCASE_ROOT/411"] |
| 35 |
["FLG",["-w","@[email protected]@30..39@[email protected]@[email protected]","-strict-sequence","-strict-formats","-short-paths","-keep-locs","-g"]] |
| 36 |
["UNIT_NAME","dune__exe__Test"] |
| 37 |
Foo: _build/default/foo |
| 38 |
["INDEX","$TESTCASE_ROOT/_build/default/.test.eobjs/cctx.ocaml-index"] |
| 39 |
["INDEX","$TESTCASE_ROOT/_build/default/.foo.objs/cctx.ocaml-index"] |
| 40 |
["STDLIB","/OCAMLC_WHERE"] |
| 41 |
["SOURCE_ROOT","$TESTCASE_ROOT"] |
| 42 |
["EXCLUDE_QUERY_DIR"] |
| 43 |
["B","$TESTCASE_ROOT/_build/default/.foo.objs/byte"] |
| 44 |
["S","$TESTCASE_ROOT"] |
| 45 |
["S","$TESTCASE_ROOT/411"] |
| 46 |
["FLG",["-w","@[email protected]@30..39@[email protected]@[email protected]","-strict-sequence","-strict-formats","-short-paths","-keep-locs","-g"]] |
| 47 |
["UNIT_NAME","foo"] |
| 48 |
Foo: _build/default/foo.ml |
| 49 |
["INDEX","$TESTCASE_ROOT/_build/default/.test.eobjs/cctx.ocaml-index"] |
| 50 |
["INDEX","$TESTCASE_ROOT/_build/default/.foo.objs/cctx.ocaml-index"] |
| 51 |
["STDLIB","/OCAMLC_WHERE"] |
| 52 |
["SOURCE_ROOT","$TESTCASE_ROOT"] |
| 53 |
["EXCLUDE_QUERY_DIR"] |
| 54 |
["B","$TESTCASE_ROOT/_build/default/.foo.objs/byte"] |
| 55 |
["S","$TESTCASE_ROOT"] |
| 56 |
["S","$TESTCASE_ROOT/411"] |
| 57 |
["FLG",["-w","@[email protected]@30..39@[email protected]@[email protected]","-strict-sequence","-strict-formats","-short-paths","-keep-locs","-g"]] |
| 58 |
["UNIT_NAME","foo"] |
| 59 |
|
| 60 |
...but not in the sub-folder whose content was copied |
| 61 |
$ dune ocaml merlin dump-config --format=json $PWD/411 | jq -r ' |
| 62 |
> include "dune"; |
| 63 |
> .[] |
| 64 |
> | merlinJsonEntry' |
| 65 |
|
| 66 |
Now we check that both querying from the root and the subfolder works |
| 67 |
$ FILE=$PWD/foo.ml |
| 68 |
$ FILE411=$PWD/411/test.ml |
| 69 |
|
| 70 |
$ printf "(4:File%d:%s)" ${#FILE} $FILE | dune ocaml-merlin | sed -E "s/[[:digit:]]+:/\?:/g" |
| 71 |
((?:INDEX?:$TESTCASE_ROOT/_build/default/.test.eobjs/cctx.ocaml-index)(?:INDEX?:$TESTCASE_ROOT/_build/default/.foo.objs/cctx.ocaml-index)(?:STDLIB?:/OCAMLC_WHERE)(?:SOURCE_ROOT?:$TESTCASE_ROOT)(?:EXCLUDE_QUERY_DIR)(?:B?:$TESTCASE_ROOT/_build/default/.foo.objs/byte)(?:S?:$TESTCASE_ROOT)(?:S?:$TESTCASE_ROOT/411)(?:FLG(?:-w?:@[email protected]@30..39@[email protected]@[email protected]?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs?:-g))(?:UNIT_NAME?:foo)) |
| 72 |
|
| 73 |
$ printf "(4:File%d:%s)" ${#FILE411} $FILE411 | dune ocaml-merlin | sed -E "s/[[:digit:]]+:/\?:/g" |
| 74 |
((?:INDEX?:$TESTCASE_ROOT/_build/default/.test.eobjs/cctx.ocaml-index)(?:INDEX?:$TESTCASE_ROOT/_build/default/.foo.objs/cctx.ocaml-index)(?:STDLIB?:/OCAMLC_WHERE)(?:SOURCE_ROOT?:$TESTCASE_ROOT)(?:EXCLUDE_QUERY_DIR)(?:B?:$TESTCASE_ROOT/_build/default/.foo.objs/byte)(?:B?:$TESTCASE_ROOT/_build/default/.test.eobjs/byte)(?:S?:$TESTCASE_ROOT)(?:S?:$TESTCASE_ROOT/411)(?:FLG(?:-w?:@[email protected]@30..39@[email protected]@[email protected]?:-strict-sequence?:-strict-formats?:-short-paths?:-keep-locs?:-g))(?:UNIT_NAME?:dune__exe__Test)) |