This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,7 @@
(executable
(name foo)
(modules foo))
(executable
(name bar)
(modules bar))

View file

@ -0,0 +1,2 @@
(lang dune 1.11)
(wrapped_executables true)

View file

@ -0,0 +1,6 @@
These tests show that (wrapped_executables true) addresses the problem of compilation
units of exes colliding with libraries.
Multiple executables defined in the same directory
$ dune build

View file

@ -0,0 +1,7 @@
(executable
(libraries foo)
(name baz))
(alias
(name default)
(action (run ./baz.exe)))

View file

@ -0,0 +1,3 @@
(lang dune 1.11)
(wrapped_executables true)

View file

@ -0,0 +1,2 @@
(* finally calling into library *)
let run () = Bar.run ()

View file

@ -0,0 +1,2 @@
(* directly usable but will cause linking error *)
let run = Foo.run

View file

@ -0,0 +1,3 @@
(library
(name foo)
(wrapped false))

View file

@ -0,0 +1 @@
let run () = print_endline "not directly usable"

View file

@ -0,0 +1,7 @@
These tests show that (wrapped_executables true) addresses the problem of compilation
units of exes colliding with libraries.
The multi module case always requires an alias.
$ dune build
not directly usable

View file

@ -0,0 +1,2 @@
(* make sure everything is linked *)
let run = Exe.run

View file

@ -0,0 +1,3 @@
(library
(name exe)
(wrapped false))

View file

@ -0,0 +1 @@
let run () = print_endline "this module is unlinkable"

View file

@ -0,0 +1,7 @@
(executable
(libraries foo)
(name exe))
(alias
(name default)
(action (run ./exe.exe)))

View file

@ -0,0 +1,5 @@
(lang dune 1.11)
(wrapped_executables true)
(implicit_transitive_deps false)

View file

@ -0,0 +1,3 @@
(library
(libraries exe)
(name foo))

View file

@ -0,0 +1,3 @@
let run () =
Exe.run ();
Collisionlib.run ()

View file

@ -0,0 +1,9 @@
These tests show that (wrapped_executables true) addresses the problem of compilation
units of exes colliding with libraries.
Single module case. Here we technically don't need an alias module
$ dune build
this module is unlinkable
this module is unlinkable