-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(melange): show compilation error for Melange public virtual lib
Signed-off-by: Antonio Nuno Monteiro <[email protected]>
- Loading branch information
1 parent
975bfec
commit e4c9a4d
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
test/blackbox-tests/test-cases/melange/virtual-lib-public.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
Test a case of virtual libraries where the virtual library is transitive | ||
|
||
$ mkdir -p vlib js_impl test | ||
$ cat > dune-project <<EOF | ||
> (lang dune 3.13) | ||
> (using melange 0.1) | ||
> (package (name the_lib)) | ||
> EOF | ||
$ cat > vlib/dune <<EOF | ||
> (library | ||
> (name the_lib) | ||
> (modes melange native) | ||
> (public_name the_lib) | ||
> (virtual_modules virt)) | ||
> EOF | ||
$ cat > vlib/the_lib.mli <<EOF | ||
> module Time : sig | ||
> val gettimeofday : unit -> float | ||
> end | ||
> EOF | ||
$ cat > vlib/the_lib.ml <<EOF | ||
> module Time = struct | ||
> let gettimeofday () = Virt.gettimeofday () | ||
> end | ||
> EOF | ||
$ cat > vlib/virt.mli <<EOF | ||
> val gettimeofday : unit -> float | ||
> EOF | ||
|
||
$ cat > js_impl/dune <<EOF | ||
> (library | ||
> (name timeJs) | ||
> (implements the_lib) | ||
> (modes melange) | ||
> (preprocess (pps melange.ppx))) | ||
> EOF | ||
$ cat > js_impl/virt.ml <<EOF | ||
> let gettimeofday : unit -> float = fun () -> 42. | ||
> EOF | ||
|
||
$ cat > test/dune <<EOF | ||
> (melange.emit | ||
> (target output) | ||
> (libraries the_lib timeJs) | ||
> (emit_stdlib false)) | ||
> EOF | ||
|
||
$ dune build @melange | ||
Error: No rule found for test/output/node_modules/the_lib/the_lib.js | ||
-> required by alias test/melange | ||
Error: No rule found for test/output/node_modules/the_lib/the_lib__.js | ||
-> required by alias test/melange | ||
[1] |