diff --git a/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/bin/dune b/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/bin/dune new file mode 100644 index 000000000000..95d07f5d928d --- /dev/null +++ b/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/bin/dune @@ -0,0 +1,3 @@ +(executable + (name main) + (libraries lib1)) \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/bin/main.ml b/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/bin/main.ml new file mode 100644 index 000000000000..2f5fb3b592da --- /dev/null +++ b/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/bin/main.ml @@ -0,0 +1 @@ +type t = Lib1.t \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/dune-project b/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/dune-project new file mode 100644 index 000000000000..f390b5360ef0 --- /dev/null +++ b/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/dune-project @@ -0,0 +1,2 @@ +(lang dune 2.0) +(implicit_transitive_deps false) \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/run.t b/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/run.t new file mode 100644 index 000000000000..63411a3e183d --- /dev/null +++ b/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/run.t @@ -0,0 +1,36 @@ + $ stdlib="$(ocamlc -where)" + $ export BUILD_PATH_PREFIX_MAP="/STDLIB=$stdlib:$BUILD_PATH_PREFIX_MAP" + + $ dune build @check + +FIXME: Merlin must be able to locate the definitions of values coming from an +implicit transitive dependency, even when `implicit-transitive-dependency` is +set to `false`. They should be part of the source path returned by the +configuration. + +In this test the dependencies are as follow: +main -> lib1 -> lib2 -> stdlib + + $ FILE=$PWD/bin/main.ml + $ printf "(4:File%d:%s)" ${#FILE} $FILE | dune ocaml-merlin | + > sed -E "s/[[:digit:]]+:/\?:/g" | tr '(' '\n' | grep -E ":[BS]H?\?" + ?:B?:$TESTCASE_ROOT/_build/default/bin/.main.eobjs/byte) + ?:B?:$TESTCASE_ROOT/_build/default/src/lib1/.lib1.objs/byte) + ?:S?:$TESTCASE_ROOT/bin) + ?:S?:$TESTCASE_ROOT/src/lib1) + + $ FILE=$PWD/src/lib1/lib1.ml + $ printf "(4:File%d:%s)" ${#FILE} $FILE | dune ocaml-merlin | + > sed -E "s/[[:digit:]]+:/\?:/g" | tr '(' '\n' | grep -E ":[BS]H?\?" + ?:B?:$TESTCASE_ROOT/_build/default/src/lib1/.lib1.objs/byte) + ?:B?:$TESTCASE_ROOT/_build/default/src/lib2/.lib2.objs/byte) + ?:S?:$TESTCASE_ROOT/src/lib1) + ?:S?:$TESTCASE_ROOT/src/lib2) + + $ FILE=$PWD/src/lib2/lib2.ml + $ printf "(4:File%d:%s)" ${#FILE} $FILE | dune ocaml-merlin | + > sed -E "s/[[:digit:]]+:/\?:/g" | tr '(' '\n' | grep -E ":[BS]H?\?" + ?:B?:/STDLIB) + ?:B?:$TESTCASE_ROOT/_build/default/src/lib2/.lib2.objs/byte) + ?:S?:/STDLIB) + ?:S?:$TESTCASE_ROOT/src/lib2) diff --git a/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/src/lib1/dune b/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/src/lib1/dune new file mode 100644 index 000000000000..70976155582c --- /dev/null +++ b/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/src/lib1/dune @@ -0,0 +1,3 @@ +(library + (name lib1) + (libraries lib2)) diff --git a/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/src/lib1/lib1.ml b/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/src/lib1/lib1.ml new file mode 100644 index 000000000000..8b4941c18c68 --- /dev/null +++ b/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/src/lib1/lib1.ml @@ -0,0 +1 @@ +include Lib2 diff --git a/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/src/lib2/dune b/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/src/lib2/dune new file mode 100644 index 000000000000..20ee4bdb2cb0 --- /dev/null +++ b/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/src/lib2/dune @@ -0,0 +1,2 @@ +(library + (name lib2)) diff --git a/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/src/lib2/lib2.ml b/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/src/lib2/lib2.ml new file mode 100644 index 000000000000..9af56f5df828 --- /dev/null +++ b/test/blackbox-tests/test-cases/merlin/implicit-transitive-deps.t/src/lib2/lib2.ml @@ -0,0 +1,3 @@ +type t = bool + +type r = float