Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(melange): double virtual library implementation #10049

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions test/blackbox-tests/test-cases/melange/double-vlib-impl.t/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(melange.emit
(target output)
(emit_stdlib false)
(libraries bar impl2)
(modules foo))

(library
(name bar)
(libraries impl1)
(modes melange)
(modules))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(lang dune 3.8)

(using melange 0.1)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let () = print_endline "should not run"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(library
(name impl1)
(modes melange)
(implements vlib))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let run () = print_endline "impl1"
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(library
(name impl2)
(modes melange)
(implements vlib))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let run () = print_endline "impl1"
21 changes: 21 additions & 0 deletions test/blackbox-tests/test-cases/melange/double-vlib-impl.t/run.t
Original file line number Diff line number Diff line change
@@ -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]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(library
(name vlib)
(modes melange)
(virtual_modules vlib))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
val run : unit -> unit
Loading