File tree 3 files changed +30
-3
lines changed
test/blackbox-tests/test-cases/virtual-libraries/implements-external.t
3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 1
- (lang dune 1 .7)
1
+ (lang dune 1 .7)
2
+
3
+ ( package (name dune-vlib))
Original file line number Diff line number Diff line change 1
1
(library
2
2
(name impl)
3
- (implements vlib))
3
+ (public_name dune-vlib.impl)
4
+ (implements vlib))
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ First we create an external library
5
5
Entering directory ' vlib'
6
6
7
7
Then we make sure that we can implement it
8
- $ env OCAMLPATH=vlib/_build/install/default /lib dune build --root impl --debug-dependency-path
8
+ $ env OCAMLPATH= vlib/ _build/ install/ default / lib dune build @ default @ install -- root impl
9
9
Entering directory ' impl'
10
10
bar from vlib
11
11
Foo. run implemented
@@ -25,3 +25,27 @@ Implement external virtual libraries with private modules
25
25
$ env OCAMLPATH= vlib/ _build/ install/ default / lib dune build -- root impl-private-module -- debug-dependency-path
26
26
Entering directory ' impl-private-module'
27
27
Name: implement virtual module. Magic number: 42
28
+
29
+ Now we test the following use case:
30
+ - A virtual library and its implementation are installed
31
+ - We are able to use the implementation as an external dependency in a project
32
+ $ export OCAMLPATH= $ PWD / vlib/ _build/ install/ default / lib : $ PWD / impl/ _build/ install/ default / lib
33
+ $ mkdir use-external-impl && cd use-external-impl
34
+ $ cat > dune-project << EOF
35
+ > (lang dune 3.0 )
36
+ > EOF
37
+ $ cat > dune << EOF
38
+ > (executable
39
+ > (name blah)
40
+ > (libraries dune-vlib. impl))
41
+ > EOF
42
+ $ cat > blah. ml << EOF
43
+ > Vlib. Foo. run ()
44
+ > EOF
45
+ $ dune exec ./ blah. exe
46
+ File " blah.ml" , line 1 , characters 0 -12:
47
+ 1 | Vlib. Foo. run ()
48
+ ^^^^^^^^^^^^
49
+ Error: Unbound module Vlib
50
+ [1 ]
51
+ $ cd ..
You can’t perform that action at this time.
0 commit comments