-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests for the implementation check.
Signed-off-by: Lucas Pluvinage <[email protected]>
- Loading branch information
Showing
21 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
4 changes: 4 additions & 0 deletions
4
test/blackbox-tests/test-cases/variants-wrong-external-declaration/exe/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 @@ | ||
(executable | ||
(name exe) | ||
(libraries vlibfoo-ext) | ||
(variants somevariant)) |
2 changes: 2 additions & 0 deletions
2
test/blackbox-tests/test-cases/variants-wrong-external-declaration/exe/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,2 @@ | ||
(lang dune 1.10) | ||
(using library_variants 0.1) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/variants-wrong-external-declaration/exe/exe.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 () = Vlibfoo.implme () |
10 changes: 10 additions & 0 deletions
10
test/blackbox-tests/test-cases/variants-wrong-external-declaration/prj1/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,10 @@ | ||
(library | ||
(name vlibfoo) | ||
(public_name vlibfoo-ext) | ||
(virtual_modules vlibfoo) | ||
) | ||
|
||
(external_variant | ||
(virtual_library vlibfoo) | ||
(variant somevariant) | ||
(implementation not-an-implementation)) |
2 changes: 2 additions & 0 deletions
2
test/blackbox-tests/test-cases/variants-wrong-external-declaration/prj1/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,2 @@ | ||
(lang dune 1.10) | ||
(using library_variants 0.2) |
Empty file.
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/variants-wrong-external-declaration/prj1/vlibfoo.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 implme : unit -> unit |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/variants-wrong-external-declaration/prj2/bar.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 implme () = print_endline "foobar" |
4 changes: 4 additions & 0 deletions
4
test/blackbox-tests/test-cases/variants-wrong-external-declaration/prj2/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 not_an_implementation) | ||
(public_name not-an-implementation) | ||
) |
2 changes: 2 additions & 0 deletions
2
test/blackbox-tests/test-cases/variants-wrong-external-declaration/prj2/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,2 @@ | ||
(lang dune 1.10) | ||
(using library_variants 0.1) |
Empty file.
7 changes: 7 additions & 0 deletions
7
test/blackbox-tests/test-cases/variants-wrong-external-declaration/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,7 @@ | ||
External declaration of an implementation, when the given library is not an | ||
implementation, should fail. | ||
|
||
$ dune build exe/exe.exe | ||
Error: "not-an-implementation" is not an implementation of "vlibfoo-ext". | ||
-> required by executable exe in exe/dune:2 | ||
[1] |
2 changes: 2 additions & 0 deletions
2
test/blackbox-tests/test-cases/vlib-wrong-default-impl/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,2 @@ | ||
(lang dune 1.10) | ||
(using library_variants 0.1) |
9 changes: 9 additions & 0 deletions
9
test/blackbox-tests/test-cases/vlib-wrong-default-impl/exe/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,9 @@ | ||
(executable | ||
(name exe) | ||
(libraries vlibfoo) | ||
) | ||
|
||
(alias | ||
(name default) | ||
(action | ||
(run ./exe.exe))) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/vlib-wrong-default-impl/exe/exe.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 () = Vlibfoo.implme () |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/vlib-wrong-default-impl/implfoo/bar.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 implme () = () |
3 changes: 3 additions & 0 deletions
3
test/blackbox-tests/test-cases/vlib-wrong-default-impl/implfoo/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 not_an_implem) | ||
) |
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 @@ | ||
Check that dune makes a proper error if the default implementation of a virtual | ||
library is not actually an implementation of the virtual library. | ||
|
||
$ dune build @default | ||
Error: "not_an_implem" is not an implementation of "vlibfoo". | ||
-> required by executable exe in exe/dune:2 | ||
[1] |
5 changes: 5 additions & 0 deletions
5
test/blackbox-tests/test-cases/vlib-wrong-default-impl/vlibfoo/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 vlibfoo) | ||
(virtual_modules vlibfoo) | ||
(default_implementation not_an_implem) | ||
) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/vlib-wrong-default-impl/vlibfoo/vlibfoo.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 implme : unit -> unit |