diff --git a/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/dune b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/dune new file mode 100644 index 00000000000..ba0793a2d69 --- /dev/null +++ b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/dune @@ -0,0 +1,11 @@ +(melange.emit + (target output) + (emit_stdlib false) + (libraries bar impl2) + (modules foo)) + +(library + (name bar) + (libraries impl1) + (modes melange) + (modules)) diff --git a/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/dune-project b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/dune-project new file mode 100644 index 00000000000..f40bf8c4a59 --- /dev/null +++ b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/dune-project @@ -0,0 +1,3 @@ +(lang dune 3.8) + +(using melange 0.1) diff --git a/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/foo.ml b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/foo.ml new file mode 100644 index 00000000000..2c0468504bc --- /dev/null +++ b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/foo.ml @@ -0,0 +1 @@ +let () = print_endline "should not run" diff --git a/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/impl1/dune b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/impl1/dune new file mode 100644 index 00000000000..37b89bac081 --- /dev/null +++ b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/impl1/dune @@ -0,0 +1,4 @@ +(library + (name impl1) + (modes melange) + (implements vlib)) diff --git a/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/impl1/vlib.ml b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/impl1/vlib.ml new file mode 100644 index 00000000000..bd1a42a6e85 --- /dev/null +++ b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/impl1/vlib.ml @@ -0,0 +1 @@ +let run () = print_endline "impl1" diff --git a/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/impl2/dune b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/impl2/dune new file mode 100644 index 00000000000..437c5ecca98 --- /dev/null +++ b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/impl2/dune @@ -0,0 +1,4 @@ +(library + (name impl2) + (modes melange) + (implements vlib)) diff --git a/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/impl2/vlib.ml b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/impl2/vlib.ml new file mode 100644 index 00000000000..bd1a42a6e85 --- /dev/null +++ b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/impl2/vlib.ml @@ -0,0 +1 @@ +let run () = print_endline "impl1" diff --git a/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/run.t b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/run.t new file mode 100644 index 00000000000..4ce28697c44 --- /dev/null +++ b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/run.t @@ -0,0 +1,21 @@ +`melange.emit` that tries to use two implementations for the same virtual lib + + $ dune build @melange + Error: Conflicting implementations for virtual library "vlib" in + _build/default/vlib: + - "impl1" in _build/default/impl1 + -> required by library "bar" in _build/default + - "impl2" in _build/default/impl2 + This cannot work. + -> required by melange target output + -> required by alias melange + Error: Conflicting implementations for virtual library "vlib" in + _build/default/vlib: + - "impl1" in _build/default/impl1 + -> required by library "bar" in _build/default + - "impl2" in _build/default/impl2 + This cannot work. + -> required by melange target output + -> required by _build/default/output/foo.js + -> required by alias melange + [1] diff --git a/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/vlib/dune b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/vlib/dune new file mode 100644 index 00000000000..ad2e731d3f5 --- /dev/null +++ b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/vlib/dune @@ -0,0 +1,4 @@ +(library + (name vlib) + (modes melange) + (virtual_modules vlib)) diff --git a/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/vlib/vlib.mli b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/vlib/vlib.mli new file mode 100644 index 00000000000..733b2a32313 --- /dev/null +++ b/test/blackbox-tests/test-cases/melange/double-vlib-impl.t/vlib/vlib.mli @@ -0,0 +1 @@ +val run : unit -> unit