-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test about dune-sites where plugin links extra libary.
For now this test gives a dynlink error about missiing library. See also #4320 Signed-off-by: Dmitrii Kosarev <[email protected]>
- Loading branch information
Showing
11 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
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,6 @@ | ||
(* load all the available plugins *) | ||
let () = Sites.Plugins.Plugins.load_all () | ||
|
||
let () = print_endline "Main app starts..." | ||
(* Execute the code registered by the plugins *) | ||
let () = Queue.iter (fun f -> f ()) Registration.todo |
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,14 @@ | ||
(executable | ||
(public_name app) | ||
(modules sites app) | ||
(libraries app.register dune-site dune-site.plugins )) | ||
|
||
(library | ||
(public_name app.register) | ||
;(libraries stdio) | ||
(name registration) | ||
(modules registration)) | ||
|
||
(generate_sites_module | ||
(module sites) | ||
(plugins (app plugins))) |
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,8 @@ | ||
(lang dune 2.8) | ||
(using dune_site 0.1) | ||
|
||
(name app) | ||
|
||
(package | ||
(name app) | ||
(sites (lib plugins))) |
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,12 @@ | ||
(env (_ (flags -w -33))) | ||
|
||
(library | ||
(public_name plugin1.plugin1_impl) | ||
(name plugin1_impl) | ||
(modules plugin1_impl) | ||
(libraries app.MyControls app.register threads)) | ||
|
||
(plugin | ||
(name plugin1) | ||
(libraries threads plugin1.plugin1_impl) | ||
(site (app plugins))) |
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,7 @@ | ||
(lang dune 2.8) | ||
(using dune_site 0.1) | ||
|
||
(generate_opam_files true) | ||
|
||
(package | ||
(name plugin1)) |
20 changes: 20 additions & 0 deletions
20
test/blackbox-tests/test-cases/sites.t/plugin/plugin1.opam
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,20 @@ | ||
# This file is generated by dune, edit dune-project instead | ||
opam-version: "2.0" | ||
depends: [ | ||
"dune" {>= "2.8"} | ||
"odoc" {with-doc} | ||
] | ||
build: [ | ||
["dune" "subst"] {dev} | ||
[ | ||
"dune" | ||
"build" | ||
"-p" | ||
name | ||
"-j" | ||
jobs | ||
"@install" | ||
"@runtest" {with-test} | ||
"@doc" {with-doc} | ||
] | ||
] |
4 changes: 4 additions & 0 deletions
4
test/blackbox-tests/test-cases/sites.t/plugin/plugin1_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,4 @@ | ||
let () = | ||
let open Thread in | ||
print_endline "Registration of Plugin1"; | ||
Queue.add (fun () -> print_endline "Plugin1 is doing something...") Registration.todo |
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 todo : (unit -> unit) Queue.t = Queue.create () |
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 @@ | ||
|
||
$ dune build ./app.exe @install | ||
$ dune exec ./app.exe | ||
|
||
|
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 @@ | ||
|
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,7 @@ | ||
(library | ||
(public_name app.MyControls) | ||
(name MyControls) | ||
|
||
(modules MyControls) | ||
(libraries ) | ||
) |