forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(melange): add test exercising ocaml#7104
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
- Loading branch information
1 parent
5de6e9f
commit e4d71c4
Showing
13 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
test/blackbox-tests/test-cases/melange/virtual_lib_compilation.t/dune
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,11 @@ | ||
(executable | ||
(name ml) | ||
(modules ml) | ||
(libraries vlib impl_ml)) | ||
|
||
(melange.emit | ||
(target output) | ||
(alias melange) | ||
(entries mel) | ||
(libraries vlib impl_melange) | ||
(module_system commonjs)) |
3 changes: 3 additions & 0 deletions
3
test/blackbox-tests/test-cases/melange/virtual_lib_compilation.t/dune-project
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,3 @@ | ||
(lang dune 3.8) | ||
|
||
(using melange 0.1) |
4 changes: 4 additions & 0 deletions
4
test/blackbox-tests/test-cases/melange/virtual_lib_compilation.t/impl_melange/dune
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,4 @@ | ||
(library | ||
(name impl_melange) | ||
(modes melange) | ||
(implements vlib)) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/melange/virtual_lib_compilation.t/impl_melange/virt.ml
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 @@ | ||
let t = "melange" |
3 changes: 3 additions & 0 deletions
3
test/blackbox-tests/test-cases/melange/virtual_lib_compilation.t/impl_ml/dune
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,3 @@ | ||
(library | ||
(name impl_ml) | ||
(implements vlib)) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/melange/virtual_lib_compilation.t/impl_ml/virt.ml
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 @@ | ||
let t = "ml" |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/melange/virtual_lib_compilation.t/mel.ml
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 @@ | ||
print_endline Virt.t |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/melange/virtual_lib_compilation.t/ml.ml
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 @@ | ||
let () = print_endline Virt.t |
42 changes: 42 additions & 0 deletions
42
test/blackbox-tests/test-cases/melange/virtual_lib_compilation.t/run.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,42 @@ | ||
Test virtual lib in an exe / melange environment | ||
|
||
$ dune build @melange --display=short | ||
ocamldep impl_melange/.impl_melange.objs/virt.impl.d | ||
ocamldep vlib/.vlib.objs/shared.impl.d | ||
ocamldep vlib/.vlib.objs/virt.intf.d | ||
ocamldep vlib/.vlib.objs/vlib_impl.impl.d | ||
melc vlib/.vlib.objs/melange/virt.{cmi,cmti} | ||
melc vlib/.vlib.objs/melange/vlib_impl.{cmi,cmj,cmt} | ||
melc vlib/.vlib.objs/melange/shared.{cmi,cmj,cmt} | ||
melc output/vlib/vlib_impl.js | ||
melc impl_melange/.impl_melange.objs/melange/virt.{cmj,cmt} | ||
melc output/vlib/shared.js | ||
melc .output.mobjs/melange/melange__Mel.{cmi,cmj,cmt} | ||
melc output/impl_melange/virt.js | ||
melc output/mel.js | ||
$ output=_build/default/output/mel.js | ||
$ test -f "$output" && node "$output" | ||
melange | ||
|
||
$ dune exec ./ml.exe --display=short | ||
ocamldep impl_ml/.impl_ml.objs/virt.impl.d | ||
ocamlc vlib/.vlib.objs/byte/virt.{cmi,cmti} | ||
ocamlc vlib/.vlib.objs/byte/vlib_impl.{cmi,cmo,cmt} | ||
ocamlopt vlib/.vlib.objs/native/vlib_impl.{cmx,o} | ||
ocamlc vlib/.vlib.objs/byte/shared.{cmi,cmo,cmt} | ||
ocamlc .ml.eobjs/byte/dune__exe__Ml.{cmi,cmti} | ||
ocamlopt vlib/.vlib.objs/native/shared.{cmx,o} | ||
ocamlopt impl_ml/.impl_ml.objs/native/virt.{cmx,o} | ||
ocamlopt .ml.eobjs/native/dune__exe__Ml.{cmx,o} | ||
ocamlopt impl_ml/impl_ml.{a,cmxa} | ||
ocamlopt ml.exe | ||
ml | ||
$ ls _build/default/vlib/.vlib.objs/byte | ||
shared.cmi | ||
shared.cmo | ||
shared.cmt | ||
virt.cmi | ||
virt.cmti | ||
vlib_impl.cmi | ||
vlib_impl.cmo | ||
vlib_impl.cmt |
5 changes: 5 additions & 0 deletions
5
test/blackbox-tests/test-cases/melange/virtual_lib_compilation.t/vlib/dune
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,5 @@ | ||
(library | ||
(name vlib) | ||
(wrapped false) | ||
(modes :standard melange) | ||
(virtual_modules virt)) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/melange/virtual_lib_compilation.t/vlib/shared.ml
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 @@ | ||
let t = Vlib_impl.hello |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/melange/virtual_lib_compilation.t/vlib/virt.mli
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 @@ | ||
val t : string |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/melange/virtual_lib_compilation.t/vlib/vlib_impl.ml
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 @@ | ||
let hello = "Hello from " ^ Virt.t |