diff --git a/test/blackbox-tests/dune.inc b/test/blackbox-tests/dune.inc index 6012ac63f6a6..a1f104aacfc1 100644 --- a/test/blackbox-tests/dune.inc +++ b/test/blackbox-tests/dune.inc @@ -1270,6 +1270,22 @@ test-cases/variants (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected))))) +(alias + (name vlib) + (deps (package dune) (source_tree test-cases/vlib)) + (action + (chdir + test-cases/vlib + (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected))))) + +(alias + (name vlib-default-impl) + (deps (package dune) (source_tree test-cases/vlib-default-impl)) + (action + (chdir + test-cases/vlib-default-impl + (progn (run %{exe:cram.exe} -test run.t) (diff? run.t run.t.corrected))))) + (alias (name windows-diff) (deps (package dune) (source_tree test-cases/windows-diff)) @@ -1460,6 +1476,8 @@ (alias utop) (alias utop-default) (alias variants) + (alias vlib) + (alias vlib-default-impl) (alias windows-diff) (alias workspaces) (alias wrapped-false-main-module-name) @@ -1607,6 +1625,8 @@ (alias upgrader) (alias use-meta) (alias variants) + (alias vlib) + (alias vlib-default-impl) (alias windows-diff) (alias workspaces) (alias wrapped-false-main-module-name) diff --git a/test/blackbox-tests/test-cases/variants/run.t b/test/blackbox-tests/test-cases/variants/run.t index 74f057bcf946..a00854fc2c7e 100644 --- a/test/blackbox-tests/test-cases/variants/run.t +++ b/test/blackbox-tests/test-cases/variants/run.t @@ -1,317 +1,3 @@ -virtual libraries may not implement their virtual modules - - $ dune build --root invalid-virtual-lib - Entering directory 'invalid-virtual-lib' - File "dune", line 3, characters 18-21: - 3 | (virtual_modules foo bar)) - ^^^ - Error: The following modules have an implementation, they cannot be listed as virtual: - - Foo - [1] - - $ cd module-fields && ocaml test.ml - impl: true. modules_without_implementation: true. virtual_modules: true. private_modules: true - File "dune", line 4, characters 18-19: - 4 | (virtual_modules m) - ^ - Error: The following modules are declared as virtual and private: - - M - This is not possible. - ------------------------- - impl: true. modules_without_implementation: true. virtual_modules: false. private_modules: true - File "dune", line 3, characters 33-34: - 3 | (modules_without_implementation m) - ^ - Error: The following modules have an implementation, they cannot be listed as modules_without_implementation: - - M - ------------------------- - impl: true. modules_without_implementation: false. virtual_modules: true. private_modules: true - File "dune", line 3, characters 18-19: - 3 | (virtual_modules m) - ^ - Error: The following modules are declared as virtual and private: - - M - This is not possible. - ------------------------- - impl: true. modules_without_implementation: false. virtual_modules: false. private_modules: true - ------------------------- - impl: false. modules_without_implementation: true. virtual_modules: true. private_modules: true - File "dune", line 4, characters 18-19: - 4 | (virtual_modules m) - ^ - Error: The following modules are declared as virtual and private: - - M - This is not possible. - ------------------------- - impl: false. modules_without_implementation: true. virtual_modules: false. private_modules: true - ------------------------- - impl: false. modules_without_implementation: false. virtual_modules: true. private_modules: true - File "dune", line 3, characters 18-19: - 3 | (virtual_modules m) - ^ - Error: The following modules are declared as virtual and private: - - M - This is not possible. - ------------------------- - impl: false. modules_without_implementation: false. virtual_modules: false. private_modules: true - File "dune", line 1, characters 0-42: - 1 | (library - 2 | (name foo) - 3 | (private_modules m)) - Warning: Some modules don't have an implementation. - You need to add the following field to this stanza: - - (modules_without_implementation m) - - This will become an error in the future. - ------------------------- - impl: true. modules_without_implementation: true. virtual_modules: true. private_modules: false - File "dune", line 4, characters 18-19: - 4 | (virtual_modules m)) - ^ - Error: These modules appear in the virtual_libraries and modules_without_implementation fields: - - M - This is not possible. - ------------------------- - impl: true. modules_without_implementation: true. virtual_modules: false. private_modules: false - File "dune", line 3, characters 33-34: - 3 | (modules_without_implementation m)) - ^ - Error: The following modules have an implementation, they cannot be listed as modules_without_implementation: - - M - ------------------------- - impl: true. modules_without_implementation: false. virtual_modules: true. private_modules: false - File "dune", line 3, characters 18-19: - 3 | (virtual_modules m)) - ^ - Error: The following modules have an implementation, they cannot be listed as virtual: - - M - ------------------------- - impl: true. modules_without_implementation: false. virtual_modules: false. private_modules: false - ------------------------- - impl: false. modules_without_implementation: true. virtual_modules: true. private_modules: false - File "dune", line 4, characters 18-19: - 4 | (virtual_modules m)) - ^ - Error: These modules appear in the virtual_libraries and modules_without_implementation fields: - - M - This is not possible. - ------------------------- - impl: false. modules_without_implementation: true. virtual_modules: false. private_modules: false - ------------------------- - impl: false. modules_without_implementation: false. virtual_modules: true. private_modules: false - ------------------------- - impl: false. modules_without_implementation: false. virtual_modules: false. private_modules: false - File "dune", line 1, characters 0-21: - 1 | (library - 2 | (name foo)) - Warning: Some modules don't have an implementation. - You need to add the following field to this stanza: - - (modules_without_implementation m) - - This will become an error in the future. - ------------------------- - -Implementations cannot introduce new modules to the library's interface - $ dune build --root impl-public-modules - Entering directory 'impl-public-modules' - File "impl/dune", line 1, characters 0-44: - 1 | (library - 2 | (name foo_impl) - 3 | (implements foo)) - Error: The following modules aren't part of the virtual library's interface: - - Baz - They must be marked as private using the (private_modules ..) field - [1] - -They can only introduce private modules: - $ dune build --root impl-private-modules - Entering directory 'impl-private-modules' - test alias default - Private module Baz - implementing bar - -Virtual library with a single module - $ dune build --root variants-simple - Entering directory 'variants-simple' - foo alias default - running implementation - -Virtual library where a wrapped module is virtual - $ dune build --root variants-sub-module - Entering directory 'variants-sub-module' - run alias default - Impl's Vmd.run () - -Executable that tries to build against a virtual library without an implementation - $ dune build --root missing-implementation - Entering directory 'missing-implementation' - Error: No implementation found for virtual library "vlib" (_build/default/vlib). - -> required by executable foo in dune:2 - [1] - -Executable that tries to use two implementations for the same virtual lib - $ dune build --root double-implementation - Entering directory 'double-implementation' - Error: Conflicting implementations for virtual library "vlib": - - "impl1" in _build/default/impl1 - -> required by library "bar" in _build/default - - "impl2" in _build/default/impl2 - This cannot work.-> required by executable foo in dune:2 - [1] - -Install files for implemenations and virtual libs have all the artifacts: - $ dune build --root install-file - Entering directory 'install-file' - lib: [ - "_build/install/default/lib/vlib/META" {"META"} - "_build/install/default/lib/vlib/dune-package" {"dune-package"} - "_build/install/default/lib/vlib/foo.mli" {"foo.mli"} - "_build/install/default/lib/vlib/opam" {"opam"} - "_build/install/default/lib/vlib/vlib.cmi" {"vlib.cmi"} - "_build/install/default/lib/vlib/vlib.cmo" {"vlib.cmo"} - "_build/install/default/lib/vlib/vlib.cmt" {"vlib.cmt"} - "_build/install/default/lib/vlib/vlib.cmx" {"vlib.cmx"} - "_build/install/default/lib/vlib/vlib.ml" {"vlib.ml"} - "_build/install/default/lib/vlib/vlib$ext_obj" {"vlib$ext_obj"} - "_build/install/default/lib/vlib/vlib__Foo.cmi" {"vlib__Foo.cmi"} - "_build/install/default/lib/vlib/vlib__Foo.cmti" {"vlib__Foo.cmti"} - ] - lib: [ - "_build/install/default/lib/impl/META" {"META"} - "_build/install/default/lib/impl/dune-package" {"dune-package"} - "_build/install/default/lib/impl/foo.ml" {"foo.ml"} - "_build/install/default/lib/impl/impl$ext_lib" {"impl$ext_lib"} - "_build/install/default/lib/impl/impl.cma" {"impl.cma"} - "_build/install/default/lib/impl/impl.cmxa" {"impl.cmxa"} - "_build/install/default/lib/impl/impl.cmxs" {"impl.cmxs"} - "_build/install/default/lib/impl/opam" {"opam"} - "_build/install/default/lib/impl/vlib__Foo.cmi" {"vlib__Foo.cmi"} - "_build/install/default/lib/impl/vlib__Foo.cmt" {"vlib__Foo.cmt"} - "_build/install/default/lib/impl/vlib__Foo.cmx" {"vlib__Foo.cmx"} - "_build/install/default/lib/impl/vlib__impl__.cmi" {"vlib__impl__.cmi"} - "_build/install/default/lib/impl/vlib__impl__.cmt" {"vlib__impl__.cmt"} - "_build/install/default/lib/impl/vlib__impl__.cmx" {"vlib__impl__.cmx"} - "_build/install/default/lib/impl/vlib__impl__.ml" {"vlib__impl__.ml"} - ] - -Implementations may refer to virtual library's modules - $ dune build --root impl-using-vlib-modules - Entering directory 'impl-using-vlib-modules' - test alias default - bar from vlib - Foo.run implemented - -Implementations may have private modules that have overlapping names with the -virtual lib - $ dune build --root private-modules-overlapping-names - Entering directory 'private-modules-overlapping-names' - foo alias default - impl's own Priv.run - implementation of foo - -Unwrapped virtual library - $ dune build --root unwrapped - Entering directory 'unwrapped' - foo alias default - Running from vlib_more - running implementation - -Unwrapped virtual library - $ dune build @install --root unwrapped/vlib - Entering directory 'unwrapped/vlib' - $ env OCAMLPATH=unwrapped/vlib/_build/install/default/lib dune build --root unwrapped/impl --debug-dependency-path - Entering directory 'unwrapped/impl' - foo alias default - Running from vlib_more - running implementation - -Implementations may not provide a library interface module unless it is virtual. -There should be an error message that clarifies this. - $ dune build --root impl-lib-interface-module @all - Entering directory 'impl-lib-interface-module' - File "impl/dune", line 1, characters 0-41: - 1 | (library - 2 | (name impl) - 3 | (implements vlib)) - Error: The following modules aren't part of the virtual library's interface: - - Vlib - They must be marked as private using the (private_modules ..) field - [1] - -Test that implementing vlibs that aren't present is impossible - $ dune build --root no-vlib-present - Entering directory 'no-vlib-present' - File "dune", line 3, characters 13-27: - 3 | (implements foobar12312414)) - ^^^^^^^^^^^^^^ - Error: Library "foobar12312414" not found. - Hint: try: dune external-lib-deps --missing --root no-vlib-present @@default - [1] - -Test that trying to implement libraries that aren't virtual results in an -appropriate error message. - $ dune build --root impl-not-virtual - Entering directory 'impl-not-virtual' - File "impl/dune", line 3, characters 13-16: - 3 | (implements lib)) - ^^^ - Error: Library "lib" is not virtual. It cannot be implemented by "impl". - [1] - -Test that trying to implement external libraries that aren't virtual results in -an appropriate error message. - $ dune build --root impl-not-virtual-external - Entering directory 'impl-not-virtual-external' - File "dune", line 7, characters 13-30: - 7 | (implements dune.configurator)) - ^^^^^^^^^^^^^^^^^ - Error: Library "dune.configurator" is not virtual. It cannot be implemented by "foobar". - [1] - -Test that we can implement external libraries. - -First we create an external library - $ dune build --root implements-external/vlib @install - Entering directory 'implements-external/vlib' - -Then we make sure that we can implement it - $ env OCAMLPATH=implements-external/vlib/_build/install/default/lib dune build --root implements-external/impl --debug-dependency-path - Entering directory 'implements-external/impl' - test alias default - bar from vlib - Foo.run implemented - -Make sure that we can also implement native only variants - $ env OCAMLPATH=implements-external/vlib/_build/install/default/lib dune build --root implements-external/impl-native-only --debug-dependency-path - Entering directory 'implements-external/impl-native-only' - run alias default - implement virtual module - -We can implement external variants with mli only modules - $ env OCAMLPATH=implements-external/vlib/_build/install/default/lib dune build --root implements-external/impl-intf-only --debug-dependency-path - Entering directory 'implements-external/impl-intf-only' - run alias default - implemented mli only - magic number: 42 - -Implement external virtual libraries with private modules - $ env OCAMLPATH=implements-external/vlib/_build/install/default/lib dune build --root implements-external/impl-private-module --debug-dependency-path - Entering directory 'implements-external/impl-private-module' - run alias default - Name: implement virtual module. Magic number: 42 - -Test that trying to specify a default implementation for a non-virtual library results -in an appropriate error message. - $ dune build --root default-impl-not-virtual-lib - Entering directory 'default-impl-not-virtual-lib' - File "dune", line 4, characters 28-36: - 4 | (default_implementation lib.impl)) - ^^^^^^^^ - Error: Only virtual libraries can specify a default implementation. - [1] - Test that trying to specify a variant for not an implementation results in an appropriate error message. $ dune build --root variant-not-implementation @@ -365,62 +51,8 @@ Check that ambiguity is handled correctly. -> required by executable bar in dune:2 [1] -Basic sample selecting implementation according to default library. - $ dune build --root default-impl - Entering directory 'default-impl' - bar alias default - hi from lib.default - Solving variant ambiguity by specifying a concrete implementation. $ dune build --root variant-with-concrete-impl Entering directory 'variant-with-concrete-impl' bar alias default hello from lib2.default - -Include variants and implementation information in dune-package - $ dune build --root dune-package-info - Entering directory 'dune-package-info' - (lang dune 1.8) - (name foo) - (library - (name foo.impl) - (kind normal) - (archives (byte impl/impl.cma) (native impl/impl.cmxa)) - (plugins (byte impl/impl.cma) (native impl/impl.cmxs)) - (foreign_archives (native impl/impl$ext_lib)) - (requires foo.vlib) - (implements vlib) - (main_module_name Vlib) - (modes byte native) - (modules - (alias_module - (name Vlib__impl__) - (obj_name vlib__impl__) - (visibility public) - (impl)) - (main_module_name Vlib) - (modules ((name Vmod) (obj_name vlib__Vmod) (visibility public) (impl))) - (wrapped true))) - (library - (name foo.vlib) - (kind normal) - (virtual) - (foreign_archives (native vlib/vlib$ext_lib)) - (main_module_name Vlib) - (modes byte native) - (modules - (alias_module (name Vlib) (obj_name vlib) (visibility public) (impl)) - (main_module_name Vlib) - (modules - ((name Vmod) - (obj_name vlib__Vmod) - (visibility public) - (kind virtual) - (intf))) - (wrapped true))) - -Virtual libraries and preprocessed source - $ dune build --root preprocess - Entering directory 'preprocess' - test alias default - foo diff --git a/test/blackbox-tests/test-cases/variants/default-impl-not-virtual-lib/dune b/test/blackbox-tests/test-cases/vlib-default-impl/default-impl-not-virtual-lib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/default-impl-not-virtual-lib/dune rename to test/blackbox-tests/test-cases/vlib-default-impl/default-impl-not-virtual-lib/dune diff --git a/test/blackbox-tests/test-cases/variants/default-impl-not-virtual-lib/dune-project b/test/blackbox-tests/test-cases/vlib-default-impl/default-impl-not-virtual-lib/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/default-impl-not-virtual-lib/dune-project rename to test/blackbox-tests/test-cases/vlib-default-impl/default-impl-not-virtual-lib/dune-project diff --git a/test/blackbox-tests/test-cases/variants/default-impl-not-virtual-lib/lib.ml b/test/blackbox-tests/test-cases/vlib-default-impl/default-impl-not-virtual-lib/lib.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/default-impl-not-virtual-lib/lib.ml rename to test/blackbox-tests/test-cases/vlib-default-impl/default-impl-not-virtual-lib/lib.ml diff --git a/test/blackbox-tests/test-cases/variants/default-impl-not-virtual-lib/lib.mli b/test/blackbox-tests/test-cases/vlib-default-impl/default-impl-not-virtual-lib/lib.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/default-impl-not-virtual-lib/lib.mli rename to test/blackbox-tests/test-cases/vlib-default-impl/default-impl-not-virtual-lib/lib.mli diff --git a/test/blackbox-tests/test-cases/variants/default-impl/bar.ml b/test/blackbox-tests/test-cases/vlib-default-impl/default-impl/bar.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/default-impl/bar.ml rename to test/blackbox-tests/test-cases/vlib-default-impl/default-impl/bar.ml diff --git a/test/blackbox-tests/test-cases/variants/default-impl/dune b/test/blackbox-tests/test-cases/vlib-default-impl/default-impl/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/default-impl/dune rename to test/blackbox-tests/test-cases/vlib-default-impl/default-impl/dune diff --git a/test/blackbox-tests/test-cases/variants/default-impl/dune-project b/test/blackbox-tests/test-cases/vlib-default-impl/default-impl/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/default-impl/dune-project rename to test/blackbox-tests/test-cases/vlib-default-impl/default-impl/dune-project diff --git a/test/blackbox-tests/test-cases/variants/default-impl/lib.default/dune b/test/blackbox-tests/test-cases/vlib-default-impl/default-impl/lib.default/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/default-impl/lib.default/dune rename to test/blackbox-tests/test-cases/vlib-default-impl/default-impl/lib.default/dune diff --git a/test/blackbox-tests/test-cases/variants/default-impl/lib.default/vlib.ml b/test/blackbox-tests/test-cases/vlib-default-impl/default-impl/lib.default/vlib.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/default-impl/lib.default/vlib.ml rename to test/blackbox-tests/test-cases/vlib-default-impl/default-impl/lib.default/vlib.ml diff --git a/test/blackbox-tests/test-cases/variants/default-impl/lib.test/dune b/test/blackbox-tests/test-cases/vlib-default-impl/default-impl/lib.test/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/default-impl/lib.test/dune rename to test/blackbox-tests/test-cases/vlib-default-impl/default-impl/lib.test/dune diff --git a/test/blackbox-tests/test-cases/variants/default-impl/lib.test/vlib.ml b/test/blackbox-tests/test-cases/vlib-default-impl/default-impl/lib.test/vlib.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/default-impl/lib.test/vlib.ml rename to test/blackbox-tests/test-cases/vlib-default-impl/default-impl/lib.test/vlib.ml diff --git a/test/blackbox-tests/test-cases/variants/default-impl/lib/dune b/test/blackbox-tests/test-cases/vlib-default-impl/default-impl/lib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/default-impl/lib/dune rename to test/blackbox-tests/test-cases/vlib-default-impl/default-impl/lib/dune diff --git a/test/blackbox-tests/test-cases/variants/default-impl/lib/vlib.mli b/test/blackbox-tests/test-cases/vlib-default-impl/default-impl/lib/vlib.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/default-impl/lib/vlib.mli rename to test/blackbox-tests/test-cases/vlib-default-impl/default-impl/lib/vlib.mli diff --git a/test/blackbox-tests/test-cases/vlib-default-impl/run.t b/test/blackbox-tests/test-cases/vlib-default-impl/run.t new file mode 100644 index 000000000000..774f471d2bf3 --- /dev/null +++ b/test/blackbox-tests/test-cases/vlib-default-impl/run.t @@ -0,0 +1,15 @@ +Test that trying to specify a default implementation for a non-virtual library results +in an appropriate error message. + $ dune build --root default-impl-not-virtual-lib + Entering directory 'default-impl-not-virtual-lib' + File "dune", line 4, characters 28-36: + 4 | (default_implementation lib.impl)) + ^^^^^^^^ + Error: Only virtual libraries can specify a default implementation. + [1] + +Basic sample selecting implementation according to default library. + $ dune build --root default-impl + Entering directory 'default-impl' + bar alias default + hi from lib.default diff --git a/test/blackbox-tests/test-cases/variants/double-implementation/dune b/test/blackbox-tests/test-cases/vlib/double-implementation/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/double-implementation/dune rename to test/blackbox-tests/test-cases/vlib/double-implementation/dune diff --git a/test/blackbox-tests/test-cases/variants/double-implementation/dune-project b/test/blackbox-tests/test-cases/vlib/double-implementation/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/double-implementation/dune-project rename to test/blackbox-tests/test-cases/vlib/double-implementation/dune-project diff --git a/test/blackbox-tests/test-cases/variants/double-implementation/foo.ml b/test/blackbox-tests/test-cases/vlib/double-implementation/foo.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/double-implementation/foo.ml rename to test/blackbox-tests/test-cases/vlib/double-implementation/foo.ml diff --git a/test/blackbox-tests/test-cases/variants/double-implementation/impl1/dune b/test/blackbox-tests/test-cases/vlib/double-implementation/impl1/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/double-implementation/impl1/dune rename to test/blackbox-tests/test-cases/vlib/double-implementation/impl1/dune diff --git a/test/blackbox-tests/test-cases/variants/double-implementation/impl1/vlib.ml b/test/blackbox-tests/test-cases/vlib/double-implementation/impl1/vlib.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/double-implementation/impl1/vlib.ml rename to test/blackbox-tests/test-cases/vlib/double-implementation/impl1/vlib.ml diff --git a/test/blackbox-tests/test-cases/variants/double-implementation/impl2/dune b/test/blackbox-tests/test-cases/vlib/double-implementation/impl2/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/double-implementation/impl2/dune rename to test/blackbox-tests/test-cases/vlib/double-implementation/impl2/dune diff --git a/test/blackbox-tests/test-cases/variants/double-implementation/impl2/vlib.ml b/test/blackbox-tests/test-cases/vlib/double-implementation/impl2/vlib.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/double-implementation/impl2/vlib.ml rename to test/blackbox-tests/test-cases/vlib/double-implementation/impl2/vlib.ml diff --git a/test/blackbox-tests/test-cases/variants/double-implementation/vlib/dune b/test/blackbox-tests/test-cases/vlib/double-implementation/vlib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/double-implementation/vlib/dune rename to test/blackbox-tests/test-cases/vlib/double-implementation/vlib/dune diff --git a/test/blackbox-tests/test-cases/variants/double-implementation/vlib/vlib.mli b/test/blackbox-tests/test-cases/vlib/double-implementation/vlib/vlib.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/double-implementation/vlib/vlib.mli rename to test/blackbox-tests/test-cases/vlib/double-implementation/vlib/vlib.mli diff --git a/test/blackbox-tests/test-cases/variants/dune-package-info/dune b/test/blackbox-tests/test-cases/vlib/dune-package-info/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/dune-package-info/dune rename to test/blackbox-tests/test-cases/vlib/dune-package-info/dune diff --git a/test/blackbox-tests/test-cases/variants/dune-package-info/dune-project b/test/blackbox-tests/test-cases/vlib/dune-package-info/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/dune-package-info/dune-project rename to test/blackbox-tests/test-cases/vlib/dune-package-info/dune-project diff --git a/test/blackbox-tests/test-cases/variants/dune-package-info/foo.opam b/test/blackbox-tests/test-cases/vlib/dune-package-info/foo.opam similarity index 100% rename from test/blackbox-tests/test-cases/variants/dune-package-info/foo.opam rename to test/blackbox-tests/test-cases/vlib/dune-package-info/foo.opam diff --git a/test/blackbox-tests/test-cases/variants/dune-package-info/impl/dune b/test/blackbox-tests/test-cases/vlib/dune-package-info/impl/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/dune-package-info/impl/dune rename to test/blackbox-tests/test-cases/vlib/dune-package-info/impl/dune diff --git a/test/blackbox-tests/test-cases/variants/dune-package-info/impl/vmod.ml b/test/blackbox-tests/test-cases/vlib/dune-package-info/impl/vmod.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/dune-package-info/impl/vmod.ml rename to test/blackbox-tests/test-cases/vlib/dune-package-info/impl/vmod.ml diff --git a/test/blackbox-tests/test-cases/variants/dune-package-info/vlib/dune b/test/blackbox-tests/test-cases/vlib/dune-package-info/vlib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/dune-package-info/vlib/dune rename to test/blackbox-tests/test-cases/vlib/dune-package-info/vlib/dune diff --git a/test/blackbox-tests/test-cases/variants/dune-package-info/vlib/vmod.mli b/test/blackbox-tests/test-cases/vlib/dune-package-info/vlib/vmod.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/dune-package-info/vlib/vmod.mli rename to test/blackbox-tests/test-cases/vlib/dune-package-info/vlib/vmod.mli diff --git a/test/blackbox-tests/test-cases/variants/impl-lib-interface-module/dune-project b/test/blackbox-tests/test-cases/vlib/impl-lib-interface-module/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-lib-interface-module/dune-project rename to test/blackbox-tests/test-cases/vlib/impl-lib-interface-module/dune-project diff --git a/test/blackbox-tests/test-cases/variants/impl-lib-interface-module/impl/dune b/test/blackbox-tests/test-cases/vlib/impl-lib-interface-module/impl/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-lib-interface-module/impl/dune rename to test/blackbox-tests/test-cases/vlib/impl-lib-interface-module/impl/dune diff --git a/test/blackbox-tests/test-cases/variants/impl-lib-interface-module/impl/foo.ml b/test/blackbox-tests/test-cases/vlib/impl-lib-interface-module/impl/foo.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-lib-interface-module/impl/foo.ml rename to test/blackbox-tests/test-cases/vlib/impl-lib-interface-module/impl/foo.ml diff --git a/test/blackbox-tests/test-cases/variants/impl-lib-interface-module/impl/vlib.ml b/test/blackbox-tests/test-cases/vlib/impl-lib-interface-module/impl/vlib.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-lib-interface-module/impl/vlib.ml rename to test/blackbox-tests/test-cases/vlib/impl-lib-interface-module/impl/vlib.ml diff --git a/test/blackbox-tests/test-cases/variants/impl-lib-interface-module/vlib/dune b/test/blackbox-tests/test-cases/vlib/impl-lib-interface-module/vlib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-lib-interface-module/vlib/dune rename to test/blackbox-tests/test-cases/vlib/impl-lib-interface-module/vlib/dune diff --git a/test/blackbox-tests/test-cases/variants/impl-lib-interface-module/vlib/foo.mli b/test/blackbox-tests/test-cases/vlib/impl-lib-interface-module/vlib/foo.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-lib-interface-module/vlib/foo.mli rename to test/blackbox-tests/test-cases/vlib/impl-lib-interface-module/vlib/foo.mli diff --git a/test/blackbox-tests/test-cases/variants/impl-not-virtual-external/dune b/test/blackbox-tests/test-cases/vlib/impl-not-virtual-external/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-not-virtual-external/dune rename to test/blackbox-tests/test-cases/vlib/impl-not-virtual-external/dune diff --git a/test/blackbox-tests/test-cases/variants/impl-not-virtual-external/dune-project b/test/blackbox-tests/test-cases/vlib/impl-not-virtual-external/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-not-virtual-external/dune-project rename to test/blackbox-tests/test-cases/vlib/impl-not-virtual-external/dune-project diff --git a/test/blackbox-tests/test-cases/variants/impl-not-virtual/dune b/test/blackbox-tests/test-cases/vlib/impl-not-virtual/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-not-virtual/dune rename to test/blackbox-tests/test-cases/vlib/impl-not-virtual/dune diff --git a/test/blackbox-tests/test-cases/variants/impl-not-virtual/dune-project b/test/blackbox-tests/test-cases/vlib/impl-not-virtual/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-not-virtual/dune-project rename to test/blackbox-tests/test-cases/vlib/impl-not-virtual/dune-project diff --git a/test/blackbox-tests/test-cases/variants/impl-not-virtual/impl/dune b/test/blackbox-tests/test-cases/vlib/impl-not-virtual/impl/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-not-virtual/impl/dune rename to test/blackbox-tests/test-cases/vlib/impl-not-virtual/impl/dune diff --git a/test/blackbox-tests/test-cases/variants/impl-not-virtual/lib/dune b/test/blackbox-tests/test-cases/vlib/impl-not-virtual/lib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-not-virtual/lib/dune rename to test/blackbox-tests/test-cases/vlib/impl-not-virtual/lib/dune diff --git a/test/blackbox-tests/test-cases/variants/impl-private-modules/dune b/test/blackbox-tests/test-cases/vlib/impl-private-modules/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-private-modules/dune rename to test/blackbox-tests/test-cases/vlib/impl-private-modules/dune diff --git a/test/blackbox-tests/test-cases/variants/impl-private-modules/dune-project b/test/blackbox-tests/test-cases/vlib/impl-private-modules/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-private-modules/dune-project rename to test/blackbox-tests/test-cases/vlib/impl-private-modules/dune-project diff --git a/test/blackbox-tests/test-cases/variants/impl-private-modules/impl/bar.ml b/test/blackbox-tests/test-cases/vlib/impl-private-modules/impl/bar.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-private-modules/impl/bar.ml rename to test/blackbox-tests/test-cases/vlib/impl-private-modules/impl/bar.ml diff --git a/test/blackbox-tests/test-cases/variants/impl-private-modules/impl/dune b/test/blackbox-tests/test-cases/vlib/impl-private-modules/impl/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-private-modules/impl/dune rename to test/blackbox-tests/test-cases/vlib/impl-private-modules/impl/dune diff --git a/test/blackbox-tests/test-cases/variants/impl-private-modules/impl/priv.ml b/test/blackbox-tests/test-cases/vlib/impl-private-modules/impl/priv.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-private-modules/impl/priv.ml rename to test/blackbox-tests/test-cases/vlib/impl-private-modules/impl/priv.ml diff --git a/test/blackbox-tests/test-cases/variants/impl-private-modules/impl/priv.mli b/test/blackbox-tests/test-cases/vlib/impl-private-modules/impl/priv.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-private-modules/impl/priv.mli rename to test/blackbox-tests/test-cases/vlib/impl-private-modules/impl/priv.mli diff --git a/test/blackbox-tests/test-cases/variants/impl-private-modules/test.ml b/test/blackbox-tests/test-cases/vlib/impl-private-modules/test.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-private-modules/test.ml rename to test/blackbox-tests/test-cases/vlib/impl-private-modules/test.ml diff --git a/test/blackbox-tests/test-cases/variants/impl-private-modules/vlib/bar.mli b/test/blackbox-tests/test-cases/vlib/impl-private-modules/vlib/bar.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-private-modules/vlib/bar.mli rename to test/blackbox-tests/test-cases/vlib/impl-private-modules/vlib/bar.mli diff --git a/test/blackbox-tests/test-cases/variants/impl-private-modules/vlib/dune b/test/blackbox-tests/test-cases/vlib/impl-private-modules/vlib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-private-modules/vlib/dune rename to test/blackbox-tests/test-cases/vlib/impl-private-modules/vlib/dune diff --git a/test/blackbox-tests/test-cases/variants/impl-public-modules/dune-project b/test/blackbox-tests/test-cases/vlib/impl-public-modules/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-public-modules/dune-project rename to test/blackbox-tests/test-cases/vlib/impl-public-modules/dune-project diff --git a/test/blackbox-tests/test-cases/variants/impl-public-modules/impl/bar.ml b/test/blackbox-tests/test-cases/vlib/impl-public-modules/impl/bar.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-public-modules/impl/bar.ml rename to test/blackbox-tests/test-cases/vlib/impl-public-modules/impl/bar.ml diff --git a/test/blackbox-tests/test-cases/variants/impl-public-modules/impl/baz.ml b/test/blackbox-tests/test-cases/vlib/impl-public-modules/impl/baz.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-public-modules/impl/baz.ml rename to test/blackbox-tests/test-cases/vlib/impl-public-modules/impl/baz.ml diff --git a/test/blackbox-tests/test-cases/variants/impl-public-modules/impl/dune b/test/blackbox-tests/test-cases/vlib/impl-public-modules/impl/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-public-modules/impl/dune rename to test/blackbox-tests/test-cases/vlib/impl-public-modules/impl/dune diff --git a/test/blackbox-tests/test-cases/variants/impl-public-modules/vlib/bar.mli b/test/blackbox-tests/test-cases/vlib/impl-public-modules/vlib/bar.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-public-modules/vlib/bar.mli rename to test/blackbox-tests/test-cases/vlib/impl-public-modules/vlib/bar.mli diff --git a/test/blackbox-tests/test-cases/variants/impl-public-modules/vlib/dune b/test/blackbox-tests/test-cases/vlib/impl-public-modules/vlib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-public-modules/vlib/dune rename to test/blackbox-tests/test-cases/vlib/impl-public-modules/vlib/dune diff --git a/test/blackbox-tests/test-cases/variants/impl-using-vlib-modules/dune b/test/blackbox-tests/test-cases/vlib/impl-using-vlib-modules/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-using-vlib-modules/dune rename to test/blackbox-tests/test-cases/vlib/impl-using-vlib-modules/dune diff --git a/test/blackbox-tests/test-cases/variants/impl-using-vlib-modules/dune-project b/test/blackbox-tests/test-cases/vlib/impl-using-vlib-modules/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-using-vlib-modules/dune-project rename to test/blackbox-tests/test-cases/vlib/impl-using-vlib-modules/dune-project diff --git a/test/blackbox-tests/test-cases/variants/impl-using-vlib-modules/impl/dune b/test/blackbox-tests/test-cases/vlib/impl-using-vlib-modules/impl/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-using-vlib-modules/impl/dune rename to test/blackbox-tests/test-cases/vlib/impl-using-vlib-modules/impl/dune diff --git a/test/blackbox-tests/test-cases/variants/impl-using-vlib-modules/impl/foo.ml b/test/blackbox-tests/test-cases/vlib/impl-using-vlib-modules/impl/foo.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-using-vlib-modules/impl/foo.ml rename to test/blackbox-tests/test-cases/vlib/impl-using-vlib-modules/impl/foo.ml diff --git a/test/blackbox-tests/test-cases/variants/impl-using-vlib-modules/test.ml b/test/blackbox-tests/test-cases/vlib/impl-using-vlib-modules/test.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-using-vlib-modules/test.ml rename to test/blackbox-tests/test-cases/vlib/impl-using-vlib-modules/test.ml diff --git a/test/blackbox-tests/test-cases/variants/impl-using-vlib-modules/vlib/bar.ml b/test/blackbox-tests/test-cases/vlib/impl-using-vlib-modules/vlib/bar.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-using-vlib-modules/vlib/bar.ml rename to test/blackbox-tests/test-cases/vlib/impl-using-vlib-modules/vlib/bar.ml diff --git a/test/blackbox-tests/test-cases/variants/impl-using-vlib-modules/vlib/dune b/test/blackbox-tests/test-cases/vlib/impl-using-vlib-modules/vlib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-using-vlib-modules/vlib/dune rename to test/blackbox-tests/test-cases/vlib/impl-using-vlib-modules/vlib/dune diff --git a/test/blackbox-tests/test-cases/variants/impl-using-vlib-modules/vlib/foo.mli b/test/blackbox-tests/test-cases/vlib/impl-using-vlib-modules/vlib/foo.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/impl-using-vlib-modules/vlib/foo.mli rename to test/blackbox-tests/test-cases/vlib/impl-using-vlib-modules/vlib/foo.mli diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl-intf-only/dune b/test/blackbox-tests/test-cases/vlib/implements-external/impl-intf-only/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl-intf-only/dune rename to test/blackbox-tests/test-cases/vlib/implements-external/impl-intf-only/dune diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl-intf-only/dune-project b/test/blackbox-tests/test-cases/vlib/implements-external/impl-intf-only/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl-intf-only/dune-project rename to test/blackbox-tests/test-cases/vlib/implements-external/impl-intf-only/dune-project diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl-intf-only/run.ml b/test/blackbox-tests/test-cases/vlib/implements-external/impl-intf-only/run.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl-intf-only/run.ml rename to test/blackbox-tests/test-cases/vlib/implements-external/impl-intf-only/run.ml diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl-intf-only/vlib_intfonly.ml b/test/blackbox-tests/test-cases/vlib/implements-external/impl-intf-only/vlib_intfonly.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl-intf-only/vlib_intfonly.ml rename to test/blackbox-tests/test-cases/vlib/implements-external/impl-intf-only/vlib_intfonly.ml diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl-native-only/dune b/test/blackbox-tests/test-cases/vlib/implements-external/impl-native-only/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl-native-only/dune rename to test/blackbox-tests/test-cases/vlib/implements-external/impl-native-only/dune diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl-native-only/dune-project b/test/blackbox-tests/test-cases/vlib/implements-external/impl-native-only/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl-native-only/dune-project rename to test/blackbox-tests/test-cases/vlib/implements-external/impl-native-only/dune-project diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl-native-only/run.ml b/test/blackbox-tests/test-cases/vlib/implements-external/impl-native-only/run.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl-native-only/run.ml rename to test/blackbox-tests/test-cases/vlib/implements-external/impl-native-only/run.ml diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl-native-only/virt_module.ml b/test/blackbox-tests/test-cases/vlib/implements-external/impl-native-only/virt_module.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl-native-only/virt_module.ml rename to test/blackbox-tests/test-cases/vlib/implements-external/impl-native-only/virt_module.ml diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl-private-module/dune b/test/blackbox-tests/test-cases/vlib/implements-external/impl-private-module/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl-private-module/dune rename to test/blackbox-tests/test-cases/vlib/implements-external/impl-private-module/dune diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl-private-module/dune-project b/test/blackbox-tests/test-cases/vlib/implements-external/impl-private-module/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl-private-module/dune-project rename to test/blackbox-tests/test-cases/vlib/implements-external/impl-private-module/dune-project diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl-private-module/run.ml b/test/blackbox-tests/test-cases/vlib/implements-external/impl-private-module/run.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl-private-module/run.ml rename to test/blackbox-tests/test-cases/vlib/implements-external/impl-private-module/run.ml diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl-private-module/virt_module.ml b/test/blackbox-tests/test-cases/vlib/implements-external/impl-private-module/virt_module.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl-private-module/virt_module.ml rename to test/blackbox-tests/test-cases/vlib/implements-external/impl-private-module/virt_module.ml diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl/dune b/test/blackbox-tests/test-cases/vlib/implements-external/impl/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl/dune rename to test/blackbox-tests/test-cases/vlib/implements-external/impl/dune diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl/dune-project b/test/blackbox-tests/test-cases/vlib/implements-external/impl/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl/dune-project rename to test/blackbox-tests/test-cases/vlib/implements-external/impl/dune-project diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl/impl-lib/dune b/test/blackbox-tests/test-cases/vlib/implements-external/impl/impl-lib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl/impl-lib/dune rename to test/blackbox-tests/test-cases/vlib/implements-external/impl/impl-lib/dune diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl/impl-lib/foo.ml b/test/blackbox-tests/test-cases/vlib/implements-external/impl/impl-lib/foo.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl/impl-lib/foo.ml rename to test/blackbox-tests/test-cases/vlib/implements-external/impl/impl-lib/foo.ml diff --git a/test/blackbox-tests/test-cases/variants/implements-external/impl/test.ml b/test/blackbox-tests/test-cases/vlib/implements-external/impl/test.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/impl/test.ml rename to test/blackbox-tests/test-cases/vlib/implements-external/impl/test.ml diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/bar.ml b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/bar.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/bar.ml rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/bar.ml diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/dune b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/dune rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/dune diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/dune-project b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/dune-project rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/dune-project diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/foo.mli b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/foo.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/foo.mli rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/foo.mli diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/intfonly/dune b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/intfonly/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/intfonly/dune rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/intfonly/dune diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/intfonly/foo.mli b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/intfonly/foo.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/intfonly/foo.mli rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/intfonly/foo.mli diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/intfonly/vlib_intfonly.mli b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/intfonly/vlib_intfonly.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/intfonly/vlib_intfonly.mli rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/intfonly/vlib_intfonly.mli diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/nativeonly/dune b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/nativeonly/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/nativeonly/dune rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/nativeonly/dune diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/nativeonly/virt_module.mli b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/nativeonly/virt_module.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/nativeonly/virt_module.mli rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/nativeonly/virt_module.mli diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/nativeonly/vlib_native_only.ml b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/nativeonly/vlib_native_only.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/nativeonly/vlib_native_only.ml rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/nativeonly/vlib_native_only.ml diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/nativeonly/vlib_native_only.mli b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/nativeonly/vlib_native_only.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/nativeonly/vlib_native_only.mli rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/nativeonly/vlib_native_only.mli diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/privatemodule/dune b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/privatemodule/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/privatemodule/dune rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/privatemodule/dune diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/privatemodule/privatemodule.ml b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/privatemodule/privatemodule.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/privatemodule/privatemodule.ml rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/privatemodule/privatemodule.ml diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/privatemodule/virt_module.mli b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/privatemodule/virt_module.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/privatemodule/virt_module.mli rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/privatemodule/virt_module.mli diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/privatemodule/vlib_privatemodule.ml b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/privatemodule/vlib_privatemodule.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/privatemodule/vlib_privatemodule.ml rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/privatemodule/vlib_privatemodule.ml diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/privatemodule/vlib_privatemodule.mli b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/privatemodule/vlib_privatemodule.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/privatemodule/vlib_privatemodule.mli rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/privatemodule/vlib_privatemodule.mli diff --git a/test/blackbox-tests/test-cases/variants/implements-external/vlib/vlib.opam b/test/blackbox-tests/test-cases/vlib/implements-external/vlib/vlib.opam similarity index 100% rename from test/blackbox-tests/test-cases/variants/implements-external/vlib/vlib.opam rename to test/blackbox-tests/test-cases/vlib/implements-external/vlib/vlib.opam diff --git a/test/blackbox-tests/test-cases/variants/install-file/dune b/test/blackbox-tests/test-cases/vlib/install-file/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/install-file/dune rename to test/blackbox-tests/test-cases/vlib/install-file/dune diff --git a/test/blackbox-tests/test-cases/variants/install-file/dune-project b/test/blackbox-tests/test-cases/vlib/install-file/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/install-file/dune-project rename to test/blackbox-tests/test-cases/vlib/install-file/dune-project diff --git a/test/blackbox-tests/test-cases/variants/install-file/impl.opam b/test/blackbox-tests/test-cases/vlib/install-file/impl.opam similarity index 100% rename from test/blackbox-tests/test-cases/variants/install-file/impl.opam rename to test/blackbox-tests/test-cases/vlib/install-file/impl.opam diff --git a/test/blackbox-tests/test-cases/variants/install-file/impl/dune b/test/blackbox-tests/test-cases/vlib/install-file/impl/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/install-file/impl/dune rename to test/blackbox-tests/test-cases/vlib/install-file/impl/dune diff --git a/test/blackbox-tests/test-cases/variants/install-file/impl/foo.ml b/test/blackbox-tests/test-cases/vlib/install-file/impl/foo.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/install-file/impl/foo.ml rename to test/blackbox-tests/test-cases/vlib/install-file/impl/foo.ml diff --git a/test/blackbox-tests/test-cases/variants/install-file/vlib.opam b/test/blackbox-tests/test-cases/vlib/install-file/vlib.opam similarity index 100% rename from test/blackbox-tests/test-cases/variants/install-file/vlib.opam rename to test/blackbox-tests/test-cases/vlib/install-file/vlib.opam diff --git a/test/blackbox-tests/test-cases/variants/install-file/vlib/dune b/test/blackbox-tests/test-cases/vlib/install-file/vlib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/install-file/vlib/dune rename to test/blackbox-tests/test-cases/vlib/install-file/vlib/dune diff --git a/test/blackbox-tests/test-cases/variants/install-file/vlib/foo.mli b/test/blackbox-tests/test-cases/vlib/install-file/vlib/foo.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/install-file/vlib/foo.mli rename to test/blackbox-tests/test-cases/vlib/install-file/vlib/foo.mli diff --git a/test/blackbox-tests/test-cases/variants/invalid-virtual-lib/bar.mli b/test/blackbox-tests/test-cases/vlib/invalid-virtual-lib/bar.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/invalid-virtual-lib/bar.mli rename to test/blackbox-tests/test-cases/vlib/invalid-virtual-lib/bar.mli diff --git a/test/blackbox-tests/test-cases/variants/invalid-virtual-lib/dune b/test/blackbox-tests/test-cases/vlib/invalid-virtual-lib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/invalid-virtual-lib/dune rename to test/blackbox-tests/test-cases/vlib/invalid-virtual-lib/dune diff --git a/test/blackbox-tests/test-cases/variants/invalid-virtual-lib/dune-project b/test/blackbox-tests/test-cases/vlib/invalid-virtual-lib/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/invalid-virtual-lib/dune-project rename to test/blackbox-tests/test-cases/vlib/invalid-virtual-lib/dune-project diff --git a/test/blackbox-tests/test-cases/variants/invalid-virtual-lib/foo.ml b/test/blackbox-tests/test-cases/vlib/invalid-virtual-lib/foo.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/invalid-virtual-lib/foo.ml rename to test/blackbox-tests/test-cases/vlib/invalid-virtual-lib/foo.ml diff --git a/test/blackbox-tests/test-cases/variants/invalid-virtual-lib/foo.mli b/test/blackbox-tests/test-cases/vlib/invalid-virtual-lib/foo.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/invalid-virtual-lib/foo.mli rename to test/blackbox-tests/test-cases/vlib/invalid-virtual-lib/foo.mli diff --git a/test/blackbox-tests/test-cases/variants/missing-implementation/dune b/test/blackbox-tests/test-cases/vlib/missing-implementation/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/missing-implementation/dune rename to test/blackbox-tests/test-cases/vlib/missing-implementation/dune diff --git a/test/blackbox-tests/test-cases/variants/missing-implementation/dune-project b/test/blackbox-tests/test-cases/vlib/missing-implementation/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/missing-implementation/dune-project rename to test/blackbox-tests/test-cases/vlib/missing-implementation/dune-project diff --git a/test/blackbox-tests/test-cases/variants/missing-implementation/foo.ml b/test/blackbox-tests/test-cases/vlib/missing-implementation/foo.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/missing-implementation/foo.ml rename to test/blackbox-tests/test-cases/vlib/missing-implementation/foo.ml diff --git a/test/blackbox-tests/test-cases/variants/missing-implementation/vlib/dune b/test/blackbox-tests/test-cases/vlib/missing-implementation/vlib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/missing-implementation/vlib/dune rename to test/blackbox-tests/test-cases/vlib/missing-implementation/vlib/dune diff --git a/test/blackbox-tests/test-cases/variants/missing-implementation/vlib/vlib.mli b/test/blackbox-tests/test-cases/vlib/missing-implementation/vlib/vlib.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/missing-implementation/vlib/vlib.mli rename to test/blackbox-tests/test-cases/vlib/missing-implementation/vlib/vlib.mli diff --git a/test/blackbox-tests/test-cases/variants/module-fields/test.ml b/test/blackbox-tests/test-cases/vlib/module-fields/test.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/module-fields/test.ml rename to test/blackbox-tests/test-cases/vlib/module-fields/test.ml diff --git a/test/blackbox-tests/test-cases/variants/no-vlib-present/dune b/test/blackbox-tests/test-cases/vlib/no-vlib-present/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/no-vlib-present/dune rename to test/blackbox-tests/test-cases/vlib/no-vlib-present/dune diff --git a/test/blackbox-tests/test-cases/variants/no-vlib-present/dune-project b/test/blackbox-tests/test-cases/vlib/no-vlib-present/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/no-vlib-present/dune-project rename to test/blackbox-tests/test-cases/vlib/no-vlib-present/dune-project diff --git a/test/blackbox-tests/test-cases/variants/preprocess/dune b/test/blackbox-tests/test-cases/vlib/preprocess/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/preprocess/dune rename to test/blackbox-tests/test-cases/vlib/preprocess/dune diff --git a/test/blackbox-tests/test-cases/variants/preprocess/dune-project b/test/blackbox-tests/test-cases/vlib/preprocess/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/preprocess/dune-project rename to test/blackbox-tests/test-cases/vlib/preprocess/dune-project diff --git a/test/blackbox-tests/test-cases/variants/preprocess/impl/dune b/test/blackbox-tests/test-cases/vlib/preprocess/impl/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/preprocess/impl/dune rename to test/blackbox-tests/test-cases/vlib/preprocess/impl/dune diff --git a/test/blackbox-tests/test-cases/variants/preprocess/impl/foo.ml b/test/blackbox-tests/test-cases/vlib/preprocess/impl/foo.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/preprocess/impl/foo.ml rename to test/blackbox-tests/test-cases/vlib/preprocess/impl/foo.ml diff --git a/test/blackbox-tests/test-cases/variants/preprocess/pp/dune b/test/blackbox-tests/test-cases/vlib/preprocess/pp/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/preprocess/pp/dune rename to test/blackbox-tests/test-cases/vlib/preprocess/pp/dune diff --git a/test/blackbox-tests/test-cases/variants/preprocess/pp/mypp.ml b/test/blackbox-tests/test-cases/vlib/preprocess/pp/mypp.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/preprocess/pp/mypp.ml rename to test/blackbox-tests/test-cases/vlib/preprocess/pp/mypp.ml diff --git a/test/blackbox-tests/test-cases/variants/preprocess/test.ml b/test/blackbox-tests/test-cases/vlib/preprocess/test.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/preprocess/test.ml rename to test/blackbox-tests/test-cases/vlib/preprocess/test.ml diff --git a/test/blackbox-tests/test-cases/variants/preprocess/vlib/dune b/test/blackbox-tests/test-cases/vlib/preprocess/vlib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/preprocess/vlib/dune rename to test/blackbox-tests/test-cases/vlib/preprocess/vlib/dune diff --git a/test/blackbox-tests/test-cases/variants/preprocess/vlib/foo.mli b/test/blackbox-tests/test-cases/vlib/preprocess/vlib/foo.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/preprocess/vlib/foo.mli rename to test/blackbox-tests/test-cases/vlib/preprocess/vlib/foo.mli diff --git a/test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/dune b/test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/dune rename to test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/dune diff --git a/test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/dune-project b/test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/dune-project rename to test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/dune-project diff --git a/test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/foo.ml b/test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/foo.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/foo.ml rename to test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/foo.ml diff --git a/test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/impl/dune b/test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/impl/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/impl/dune rename to test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/impl/dune diff --git a/test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/impl/priv.ml b/test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/impl/priv.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/impl/priv.ml rename to test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/impl/priv.ml diff --git a/test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/impl/vlib.ml b/test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/impl/vlib.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/impl/vlib.ml rename to test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/impl/vlib.ml diff --git a/test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/vlib/dune b/test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/vlib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/vlib/dune rename to test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/vlib/dune diff --git a/test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/vlib/priv.ml b/test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/vlib/priv.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/vlib/priv.ml rename to test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/vlib/priv.ml diff --git a/test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/vlib/vlib.mli b/test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/vlib/vlib.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/private-modules-overlapping-names/vlib/vlib.mli rename to test/blackbox-tests/test-cases/vlib/private-modules-overlapping-names/vlib/vlib.mli diff --git a/test/blackbox-tests/test-cases/vlib/run.t b/test/blackbox-tests/test-cases/vlib/run.t new file mode 100644 index 000000000000..b947285690d4 --- /dev/null +++ b/test/blackbox-tests/test-cases/vlib/run.t @@ -0,0 +1,351 @@ +virtual libraries may not implement their virtual modules + + $ dune build --root invalid-virtual-lib + Entering directory 'invalid-virtual-lib' + File "dune", line 3, characters 18-21: + 3 | (virtual_modules foo bar)) + ^^^ + Error: The following modules have an implementation, they cannot be listed as virtual: + - Foo + [1] + + $ cd module-fields && ocaml test.ml + impl: true. modules_without_implementation: true. virtual_modules: true. private_modules: true + File "dune", line 4, characters 18-19: + 4 | (virtual_modules m) + ^ + Error: The following modules are declared as virtual and private: + - M + This is not possible. + ------------------------- + impl: true. modules_without_implementation: true. virtual_modules: false. private_modules: true + File "dune", line 3, characters 33-34: + 3 | (modules_without_implementation m) + ^ + Error: The following modules have an implementation, they cannot be listed as modules_without_implementation: + - M + ------------------------- + impl: true. modules_without_implementation: false. virtual_modules: true. private_modules: true + File "dune", line 3, characters 18-19: + 3 | (virtual_modules m) + ^ + Error: The following modules are declared as virtual and private: + - M + This is not possible. + ------------------------- + impl: true. modules_without_implementation: false. virtual_modules: false. private_modules: true + ------------------------- + impl: false. modules_without_implementation: true. virtual_modules: true. private_modules: true + File "dune", line 4, characters 18-19: + 4 | (virtual_modules m) + ^ + Error: The following modules are declared as virtual and private: + - M + This is not possible. + ------------------------- + impl: false. modules_without_implementation: true. virtual_modules: false. private_modules: true + ------------------------- + impl: false. modules_without_implementation: false. virtual_modules: true. private_modules: true + File "dune", line 3, characters 18-19: + 3 | (virtual_modules m) + ^ + Error: The following modules are declared as virtual and private: + - M + This is not possible. + ------------------------- + impl: false. modules_without_implementation: false. virtual_modules: false. private_modules: true + File "dune", line 1, characters 0-42: + 1 | (library + 2 | (name foo) + 3 | (private_modules m)) + Warning: Some modules don't have an implementation. + You need to add the following field to this stanza: + + (modules_without_implementation m) + + This will become an error in the future. + ------------------------- + impl: true. modules_without_implementation: true. virtual_modules: true. private_modules: false + File "dune", line 4, characters 18-19: + 4 | (virtual_modules m)) + ^ + Error: These modules appear in the virtual_libraries and modules_without_implementation fields: + - M + This is not possible. + ------------------------- + impl: true. modules_without_implementation: true. virtual_modules: false. private_modules: false + File "dune", line 3, characters 33-34: + 3 | (modules_without_implementation m)) + ^ + Error: The following modules have an implementation, they cannot be listed as modules_without_implementation: + - M + ------------------------- + impl: true. modules_without_implementation: false. virtual_modules: true. private_modules: false + File "dune", line 3, characters 18-19: + 3 | (virtual_modules m)) + ^ + Error: The following modules have an implementation, they cannot be listed as virtual: + - M + ------------------------- + impl: true. modules_without_implementation: false. virtual_modules: false. private_modules: false + ------------------------- + impl: false. modules_without_implementation: true. virtual_modules: true. private_modules: false + File "dune", line 4, characters 18-19: + 4 | (virtual_modules m)) + ^ + Error: These modules appear in the virtual_libraries and modules_without_implementation fields: + - M + This is not possible. + ------------------------- + impl: false. modules_without_implementation: true. virtual_modules: false. private_modules: false + ------------------------- + impl: false. modules_without_implementation: false. virtual_modules: true. private_modules: false + ------------------------- + impl: false. modules_without_implementation: false. virtual_modules: false. private_modules: false + File "dune", line 1, characters 0-21: + 1 | (library + 2 | (name foo)) + Warning: Some modules don't have an implementation. + You need to add the following field to this stanza: + + (modules_without_implementation m) + + This will become an error in the future. + ------------------------- + +Implementations cannot introduce new modules to the library's interface + $ dune build --root impl-public-modules + Entering directory 'impl-public-modules' + File "impl/dune", line 1, characters 0-44: + 1 | (library + 2 | (name foo_impl) + 3 | (implements foo)) + Error: The following modules aren't part of the virtual library's interface: + - Baz + They must be marked as private using the (private_modules ..) field + [1] + +They can only introduce private modules: + $ dune build --root impl-private-modules + Entering directory 'impl-private-modules' + test alias default + Private module Baz + implementing bar + +Virtual library with a single module + $ dune build --root variants-simple + Entering directory 'variants-simple' + foo alias default + running implementation + +Virtual library where a wrapped module is virtual + $ dune build --root variants-sub-module + Entering directory 'variants-sub-module' + run alias default + Impl's Vmd.run () + +Executable that tries to build against a virtual library without an implementation + $ dune build --root missing-implementation + Entering directory 'missing-implementation' + Error: No implementation found for virtual library "vlib" (_build/default/vlib). + -> required by executable foo in dune:2 + [1] + +Executable that tries to use two implementations for the same virtual lib + $ dune build --root double-implementation + Entering directory 'double-implementation' + Error: Conflicting implementations for virtual library "vlib": + - "impl1" in _build/default/impl1 + -> required by library "bar" in _build/default + - "impl2" in _build/default/impl2 + This cannot work.-> required by executable foo in dune:2 + [1] + +Install files for implemenations and virtual libs have all the artifacts: + $ dune build --root install-file + Entering directory 'install-file' + lib: [ + "_build/install/default/lib/vlib/META" {"META"} + "_build/install/default/lib/vlib/dune-package" {"dune-package"} + "_build/install/default/lib/vlib/foo.mli" {"foo.mli"} + "_build/install/default/lib/vlib/opam" {"opam"} + "_build/install/default/lib/vlib/vlib.cmi" {"vlib.cmi"} + "_build/install/default/lib/vlib/vlib.cmo" {"vlib.cmo"} + "_build/install/default/lib/vlib/vlib.cmt" {"vlib.cmt"} + "_build/install/default/lib/vlib/vlib.cmx" {"vlib.cmx"} + "_build/install/default/lib/vlib/vlib.ml" {"vlib.ml"} + "_build/install/default/lib/vlib/vlib$ext_obj" {"vlib$ext_obj"} + "_build/install/default/lib/vlib/vlib__Foo.cmi" {"vlib__Foo.cmi"} + "_build/install/default/lib/vlib/vlib__Foo.cmti" {"vlib__Foo.cmti"} + ] + lib: [ + "_build/install/default/lib/impl/META" {"META"} + "_build/install/default/lib/impl/dune-package" {"dune-package"} + "_build/install/default/lib/impl/foo.ml" {"foo.ml"} + "_build/install/default/lib/impl/impl$ext_lib" {"impl$ext_lib"} + "_build/install/default/lib/impl/impl.cma" {"impl.cma"} + "_build/install/default/lib/impl/impl.cmxa" {"impl.cmxa"} + "_build/install/default/lib/impl/impl.cmxs" {"impl.cmxs"} + "_build/install/default/lib/impl/opam" {"opam"} + "_build/install/default/lib/impl/vlib__Foo.cmi" {"vlib__Foo.cmi"} + "_build/install/default/lib/impl/vlib__Foo.cmt" {"vlib__Foo.cmt"} + "_build/install/default/lib/impl/vlib__Foo.cmx" {"vlib__Foo.cmx"} + "_build/install/default/lib/impl/vlib__impl__.cmi" {"vlib__impl__.cmi"} + "_build/install/default/lib/impl/vlib__impl__.cmt" {"vlib__impl__.cmt"} + "_build/install/default/lib/impl/vlib__impl__.cmx" {"vlib__impl__.cmx"} + "_build/install/default/lib/impl/vlib__impl__.ml" {"vlib__impl__.ml"} + ] + +Implementations may refer to virtual library's modules + $ dune build --root impl-using-vlib-modules + Entering directory 'impl-using-vlib-modules' + test alias default + bar from vlib + Foo.run implemented + +Implementations may have private modules that have overlapping names with the +virtual lib + $ dune build --root private-modules-overlapping-names + Entering directory 'private-modules-overlapping-names' + foo alias default + impl's own Priv.run + implementation of foo + +Unwrapped virtual library + $ dune build --root unwrapped + Entering directory 'unwrapped' + foo alias default + Running from vlib_more + running implementation + +Unwrapped virtual library + $ dune build @install --root unwrapped/vlib + Entering directory 'unwrapped/vlib' + $ env OCAMLPATH=unwrapped/vlib/_build/install/default/lib dune build --root unwrapped/impl --debug-dependency-path + Entering directory 'unwrapped/impl' + foo alias default + Running from vlib_more + running implementation + +Implementations may not provide a library interface module unless it is virtual. +There should be an error message that clarifies this. + $ dune build --root impl-lib-interface-module @all + Entering directory 'impl-lib-interface-module' + File "impl/dune", line 1, characters 0-41: + 1 | (library + 2 | (name impl) + 3 | (implements vlib)) + Error: The following modules aren't part of the virtual library's interface: + - Vlib + They must be marked as private using the (private_modules ..) field + [1] + +Test that implementing vlibs that aren't present is impossible + $ dune build --root no-vlib-present + Entering directory 'no-vlib-present' + File "dune", line 3, characters 13-27: + 3 | (implements foobar12312414)) + ^^^^^^^^^^^^^^ + Error: Library "foobar12312414" not found. + Hint: try: dune external-lib-deps --missing --root no-vlib-present @@default + [1] + +Test that trying to implement libraries that aren't virtual results in an +appropriate error message. + $ dune build --root impl-not-virtual + Entering directory 'impl-not-virtual' + File "impl/dune", line 3, characters 13-16: + 3 | (implements lib)) + ^^^ + Error: Library "lib" is not virtual. It cannot be implemented by "impl". + [1] + +Test that trying to implement external libraries that aren't virtual results in +an appropriate error message. + $ dune build --root impl-not-virtual-external + Entering directory 'impl-not-virtual-external' + File "dune", line 7, characters 13-30: + 7 | (implements dune.configurator)) + ^^^^^^^^^^^^^^^^^ + Error: Library "dune.configurator" is not virtual. It cannot be implemented by "foobar". + [1] + +Test that we can implement external libraries. + +First we create an external library + $ dune build --root implements-external/vlib @install + Entering directory 'implements-external/vlib' + +Then we make sure that we can implement it + $ env OCAMLPATH=implements-external/vlib/_build/install/default/lib dune build --root implements-external/impl --debug-dependency-path + Entering directory 'implements-external/impl' + test alias default + bar from vlib + Foo.run implemented + +Make sure that we can also implement native only variants + $ env OCAMLPATH=implements-external/vlib/_build/install/default/lib dune build --root implements-external/impl-native-only --debug-dependency-path + Entering directory 'implements-external/impl-native-only' + run alias default + implement virtual module + +We can implement external variants with mli only modules + $ env OCAMLPATH=implements-external/vlib/_build/install/default/lib dune build --root implements-external/impl-intf-only --debug-dependency-path + Entering directory 'implements-external/impl-intf-only' + run alias default + implemented mli only + magic number: 42 + +Implement external virtual libraries with private modules + $ env OCAMLPATH=implements-external/vlib/_build/install/default/lib dune build --root implements-external/impl-private-module --debug-dependency-path + Entering directory 'implements-external/impl-private-module' + run alias default + Name: implement virtual module. Magic number: 42 + +Include variants and implementation information in dune-package + $ dune build --root dune-package-info + Entering directory 'dune-package-info' + (lang dune 1.8) + (name foo) + (library + (name foo.impl) + (kind normal) + (archives (byte impl/impl.cma) (native impl/impl.cmxa)) + (plugins (byte impl/impl.cma) (native impl/impl.cmxs)) + (foreign_archives (native impl/impl$ext_lib)) + (requires foo.vlib) + (implements vlib) + (main_module_name Vlib) + (modes byte native) + (modules + (alias_module + (name Vlib__impl__) + (obj_name vlib__impl__) + (visibility public) + (impl)) + (main_module_name Vlib) + (modules ((name Vmod) (obj_name vlib__Vmod) (visibility public) (impl))) + (wrapped true))) + (library + (name foo.vlib) + (kind normal) + (virtual) + (foreign_archives (native vlib/vlib$ext_lib)) + (main_module_name Vlib) + (modes byte native) + (modules + (alias_module (name Vlib) (obj_name vlib) (visibility public) (impl)) + (main_module_name Vlib) + (modules + ((name Vmod) + (obj_name vlib__Vmod) + (visibility public) + (kind virtual) + (intf))) + (wrapped true))) + +Virtual libraries and preprocessed source + $ dune build --root preprocess + Entering directory 'preprocess' + test alias default + foo diff --git a/test/blackbox-tests/test-cases/variants/unwrapped/dune b/test/blackbox-tests/test-cases/vlib/unwrapped/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/unwrapped/dune rename to test/blackbox-tests/test-cases/vlib/unwrapped/dune diff --git a/test/blackbox-tests/test-cases/variants/unwrapped/dune-project b/test/blackbox-tests/test-cases/vlib/unwrapped/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/unwrapped/dune-project rename to test/blackbox-tests/test-cases/vlib/unwrapped/dune-project diff --git a/test/blackbox-tests/test-cases/variants/unwrapped/impl/bin/dune b/test/blackbox-tests/test-cases/vlib/unwrapped/impl/bin/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/unwrapped/impl/bin/dune rename to test/blackbox-tests/test-cases/vlib/unwrapped/impl/bin/dune diff --git a/test/blackbox-tests/test-cases/variants/unwrapped/impl/bin/dune-project b/test/blackbox-tests/test-cases/vlib/unwrapped/impl/bin/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/unwrapped/impl/bin/dune-project rename to test/blackbox-tests/test-cases/vlib/unwrapped/impl/bin/dune-project diff --git a/test/blackbox-tests/test-cases/variants/unwrapped/impl/bin/foo.ml b/test/blackbox-tests/test-cases/vlib/unwrapped/impl/bin/foo.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/unwrapped/impl/bin/foo.ml rename to test/blackbox-tests/test-cases/vlib/unwrapped/impl/bin/foo.ml diff --git a/test/blackbox-tests/test-cases/variants/unwrapped/impl/dune b/test/blackbox-tests/test-cases/vlib/unwrapped/impl/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/unwrapped/impl/dune rename to test/blackbox-tests/test-cases/vlib/unwrapped/impl/dune diff --git a/test/blackbox-tests/test-cases/variants/unwrapped/impl/dune-project b/test/blackbox-tests/test-cases/vlib/unwrapped/impl/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/unwrapped/impl/dune-project rename to test/blackbox-tests/test-cases/vlib/unwrapped/impl/dune-project diff --git a/test/blackbox-tests/test-cases/variants/unwrapped/impl/impl_wrapped.opam b/test/blackbox-tests/test-cases/vlib/unwrapped/impl/impl_wrapped.opam similarity index 100% rename from test/blackbox-tests/test-cases/variants/unwrapped/impl/impl_wrapped.opam rename to test/blackbox-tests/test-cases/vlib/unwrapped/impl/impl_wrapped.opam diff --git a/test/blackbox-tests/test-cases/variants/unwrapped/impl/vlib.ml b/test/blackbox-tests/test-cases/vlib/unwrapped/impl/vlib.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/unwrapped/impl/vlib.ml rename to test/blackbox-tests/test-cases/vlib/unwrapped/impl/vlib.ml diff --git a/test/blackbox-tests/test-cases/variants/unwrapped/vlib/dune b/test/blackbox-tests/test-cases/vlib/unwrapped/vlib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/unwrapped/vlib/dune rename to test/blackbox-tests/test-cases/vlib/unwrapped/vlib/dune diff --git a/test/blackbox-tests/test-cases/variants/unwrapped/vlib/dune-project b/test/blackbox-tests/test-cases/vlib/unwrapped/vlib/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/unwrapped/vlib/dune-project rename to test/blackbox-tests/test-cases/vlib/unwrapped/vlib/dune-project diff --git a/test/blackbox-tests/test-cases/variants/unwrapped/vlib/vlib.mli b/test/blackbox-tests/test-cases/vlib/unwrapped/vlib/vlib.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/unwrapped/vlib/vlib.mli rename to test/blackbox-tests/test-cases/vlib/unwrapped/vlib/vlib.mli diff --git a/test/blackbox-tests/test-cases/variants/unwrapped/vlib/vlib_more.ml b/test/blackbox-tests/test-cases/vlib/unwrapped/vlib/vlib_more.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/unwrapped/vlib/vlib_more.ml rename to test/blackbox-tests/test-cases/vlib/unwrapped/vlib/vlib_more.ml diff --git a/test/blackbox-tests/test-cases/variants/unwrapped/vlib/vlib_wrapped.opam b/test/blackbox-tests/test-cases/vlib/unwrapped/vlib/vlib_wrapped.opam similarity index 100% rename from test/blackbox-tests/test-cases/variants/unwrapped/vlib/vlib_wrapped.opam rename to test/blackbox-tests/test-cases/vlib/unwrapped/vlib/vlib_wrapped.opam diff --git a/test/blackbox-tests/test-cases/variants/variants-simple/dune b/test/blackbox-tests/test-cases/vlib/variants-simple/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/variants-simple/dune rename to test/blackbox-tests/test-cases/vlib/variants-simple/dune diff --git a/test/blackbox-tests/test-cases/variants/variants-simple/dune-project b/test/blackbox-tests/test-cases/vlib/variants-simple/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/variants-simple/dune-project rename to test/blackbox-tests/test-cases/vlib/variants-simple/dune-project diff --git a/test/blackbox-tests/test-cases/variants/variants-simple/foo.ml b/test/blackbox-tests/test-cases/vlib/variants-simple/foo.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/variants-simple/foo.ml rename to test/blackbox-tests/test-cases/vlib/variants-simple/foo.ml diff --git a/test/blackbox-tests/test-cases/variants/variants-simple/impl/dune b/test/blackbox-tests/test-cases/vlib/variants-simple/impl/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/variants-simple/impl/dune rename to test/blackbox-tests/test-cases/vlib/variants-simple/impl/dune diff --git a/test/blackbox-tests/test-cases/variants/variants-simple/impl/vlib.ml b/test/blackbox-tests/test-cases/vlib/variants-simple/impl/vlib.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/variants-simple/impl/vlib.ml rename to test/blackbox-tests/test-cases/vlib/variants-simple/impl/vlib.ml diff --git a/test/blackbox-tests/test-cases/variants/variants-simple/vlib/dune b/test/blackbox-tests/test-cases/vlib/variants-simple/vlib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/variants-simple/vlib/dune rename to test/blackbox-tests/test-cases/vlib/variants-simple/vlib/dune diff --git a/test/blackbox-tests/test-cases/variants/variants-simple/vlib/vlib.mli b/test/blackbox-tests/test-cases/vlib/variants-simple/vlib/vlib.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/variants-simple/vlib/vlib.mli rename to test/blackbox-tests/test-cases/vlib/variants-simple/vlib/vlib.mli diff --git a/test/blackbox-tests/test-cases/variants/variants-sub-module/dune b/test/blackbox-tests/test-cases/vlib/variants-sub-module/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/variants-sub-module/dune rename to test/blackbox-tests/test-cases/vlib/variants-sub-module/dune diff --git a/test/blackbox-tests/test-cases/variants/variants-sub-module/dune-project b/test/blackbox-tests/test-cases/vlib/variants-sub-module/dune-project similarity index 100% rename from test/blackbox-tests/test-cases/variants/variants-sub-module/dune-project rename to test/blackbox-tests/test-cases/vlib/variants-sub-module/dune-project diff --git a/test/blackbox-tests/test-cases/variants/variants-sub-module/impl/dune b/test/blackbox-tests/test-cases/vlib/variants-sub-module/impl/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/variants-sub-module/impl/dune rename to test/blackbox-tests/test-cases/vlib/variants-sub-module/impl/dune diff --git a/test/blackbox-tests/test-cases/variants/variants-sub-module/impl/vmod.ml b/test/blackbox-tests/test-cases/vlib/variants-sub-module/impl/vmod.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/variants-sub-module/impl/vmod.ml rename to test/blackbox-tests/test-cases/vlib/variants-sub-module/impl/vmod.ml diff --git a/test/blackbox-tests/test-cases/variants/variants-sub-module/run.ml b/test/blackbox-tests/test-cases/vlib/variants-sub-module/run.ml similarity index 100% rename from test/blackbox-tests/test-cases/variants/variants-sub-module/run.ml rename to test/blackbox-tests/test-cases/vlib/variants-sub-module/run.ml diff --git a/test/blackbox-tests/test-cases/variants/variants-sub-module/vlib/dune b/test/blackbox-tests/test-cases/vlib/variants-sub-module/vlib/dune similarity index 100% rename from test/blackbox-tests/test-cases/variants/variants-sub-module/vlib/dune rename to test/blackbox-tests/test-cases/vlib/variants-sub-module/vlib/dune diff --git a/test/blackbox-tests/test-cases/variants/variants-sub-module/vlib/vmod.mli b/test/blackbox-tests/test-cases/vlib/variants-sub-module/vlib/vmod.mli similarity index 100% rename from test/blackbox-tests/test-cases/variants/variants-sub-module/vlib/vmod.mli rename to test/blackbox-tests/test-cases/vlib/variants-sub-module/vlib/vmod.mli