Skip to content

Commit

Permalink
[sites] Complicate the test: tring to load same library twice
Browse files Browse the repository at this point in the history
It should make @ejgallego less worried

Signed-off-by: Dmitrii Kosarev <Dmitrii.Kosarev@pm.me>
  • Loading branch information
Dmitrii Kosarev authored and bobot committed Oct 1, 2021
1 parent 68a7527 commit ac872ff
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 1 deletion.
15 changes: 15 additions & 0 deletions otherlibs/site/test/plugin_require_thread.t/plugin2/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(env
(_
(flags -w -33)))

(library
(public_name plugin2.plugin2_impl)
(name plugin2_impl)
(modules plugin2_impl)
(libraries app.MyControls app.register result threads))

(plugin
(name plugin2)
(libraries threads plugin2.plugin2_impl)
(site
(app plugins)))
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(lang dune 2.8)

(using dune_site 0.1)

(generate_opam_files true)

(package
(name plugin2))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
let () =
print_endline "Registration of Plugin2";
Queue.add (fun () -> print_endline "Plugin2 is doing something...") Registration.todo
4 changes: 4 additions & 0 deletions otherlibs/site/test/plugin_require_thread.t/run.t
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@

$ dune build ./app.exe @install
$ dune exec ./app.exe
The library is being used by two plugins finished initialization
Fatal error: exception Dune_site_plugins__Plugins.Thread_library_required_by_plugin_but_not_required_by_main_executable
[2]

$ sed -i -e "s/;TOREMOVE//" dune

$ dune build ./app.exe @install
$ dune exec ./app.exe
The library is being used by two plugins finished initialization
Registration of Plugin1
Registration of Plugin2
Main app starts...
Plugin1 is doing something...
Plugin2 is doing something...
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let () = print_endline "The library is being used by two plugins finished initialization"
2 changes: 1 addition & 1 deletion otherlibs/site/test/plugin_require_thread.t/stubs/dune
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(library
(public_name app.MyControls)
(name MyControls)
(modules)
(modules MyControls)
(libraries))

0 comments on commit ac872ff

Please sign in to comment.