-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test cases to show binary/lib name collisions (#2358)
Add test cases to show binary/lib name collisions
- Loading branch information
Showing
17 changed files
with
67 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
2 changes: 2 additions & 0 deletions
2
test/blackbox-tests/test-cases/exe-name-mangle/multi-module/baz.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,2 @@ | ||
let () = | ||
Foo.run () |
7 changes: 7 additions & 0 deletions
7
test/blackbox-tests/test-cases/exe-name-mangle/multi-module/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,7 @@ | ||
(executable | ||
(libraries foo) | ||
(name baz)) | ||
|
||
(alias | ||
(name default) | ||
(action (run ./baz.exe))) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/exe-name-mangle/multi-module/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 @@ | ||
(lang dune 1.11) |
2 changes: 2 additions & 0 deletions
2
test/blackbox-tests/test-cases/exe-name-mangle/multi-module/foo.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,2 @@ | ||
(* finally calling into library *) | ||
let run = Bar.run () |
2 changes: 2 additions & 0 deletions
2
test/blackbox-tests/test-cases/exe-name-mangle/multi-module/foo/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,2 @@ | ||
(* directly usable but will cause linking error *) | ||
let run = Foo.run |
3 changes: 3 additions & 0 deletions
3
test/blackbox-tests/test-cases/exe-name-mangle/multi-module/foo/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 foo) | ||
(wrapped false)) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/exe-name-mangle/multi-module/foo/foo.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 run () = print_endline "not directly usable" |
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,15 @@ | ||
Binary composed of a single module with the same name as the dependency | ||
$ dune build --root single-module 2>&1 | grep -v ocamlopt | ||
Entering directory 'single-module' | ||
File "exe.ml", line 1: | ||
Error: The files foo/.foo.objs/byte/foo.cmi and .exe.eobjs/byte/exe.cmi | ||
make inconsistent assumptions over interface Exe | ||
Binary composed of multiple modules where one collides with a dependency | ||
$ dune build --root multi-module 2>&1 | grep -v ocamlopt | grep -v ocamlc | ||
Entering directory 'multi-module' | ||
File "foo.ml", line 1: | ||
Error: The files foo/.foo.objs/byte/bar.cmi and .baz.eobjs/byte/foo.cmi | ||
make inconsistent assumptions over interface Foo | ||
File "baz.ml", line 1: | ||
Error: The files .baz.eobjs/byte/foo.cmi and .baz.eobjs/byte/foo.cmi | ||
make inconsistent assumptions over interface Foo |
2 changes: 2 additions & 0 deletions
2
test/blackbox-tests/test-cases/exe-name-mangle/single-module/collision-lib/collisionlib.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,2 @@ | ||
(* make sure everything is linked *) | ||
let run = Exe.run |
3 changes: 3 additions & 0 deletions
3
test/blackbox-tests/test-cases/exe-name-mangle/single-module/collision-lib/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 exe) | ||
(wrapped false)) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/exe-name-mangle/single-module/collision-lib/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 run () = print_endline "this module is unlinkable" |
7 changes: 7 additions & 0 deletions
7
test/blackbox-tests/test-cases/exe-name-mangle/single-module/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,7 @@ | ||
(executable | ||
(libraries foo) | ||
(name exe)) | ||
|
||
(alias | ||
(name default) | ||
(action (run ./exe.exe))) |
3 changes: 3 additions & 0 deletions
3
test/blackbox-tests/test-cases/exe-name-mangle/single-module/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 1.11) | ||
|
||
(implicit_transitive_deps false) |
2 changes: 2 additions & 0 deletions
2
test/blackbox-tests/test-cases/exe-name-mangle/single-module/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,2 @@ | ||
let () = | ||
Foo.run () |
3 changes: 3 additions & 0 deletions
3
test/blackbox-tests/test-cases/exe-name-mangle/single-module/foo/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 | ||
(libraries exe) | ||
(name foo)) |
3 changes: 3 additions & 0 deletions
3
test/blackbox-tests/test-cases/exe-name-mangle/single-module/foo/foo.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,3 @@ | ||
let run () = | ||
Exe.run (); | ||
Collisionlib.run () |