-
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.
Browse files
Browse the repository at this point in the history
* test: add a repro for #10582 Signed-off-by: Masayuki Takeda <[email protected]> Co-authored-by: Antonio Nuno Monteiro <[email protected]> Co-authored-by: Etienne Millon <[email protected]>
- Loading branch information
1 parent
72c5505
commit e74efa6
Showing
2 changed files
with
56 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
47 changes: 47 additions & 0 deletions
47
test/blackbox-tests/test-cases/mdx-stanza/shared-libraries.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,47 @@ | ||
mdx supports dependencies referencing shared libraries. | ||
|
||
See #10582. | ||
|
||
$ cat > dune-project << EOF | ||
> (lang dune 3.15) | ||
> (name dune_mdx_test) | ||
> (using mdx 0.4) | ||
> EOF | ||
|
||
$ cat > dune << EOF | ||
> (library | ||
> (name public_lib) | ||
> (foreign_archives test)) | ||
> | ||
> (rule | ||
> (deps test.c) | ||
> (targets libtest.a dlltest.so) | ||
> (action | ||
> (progn | ||
> (run gcc -c -fPIC test.c -o test.o) | ||
> (run gcc test.o -shared -o dlltest.so) | ||
> (run ar rcs libtest.a test.o)))) | ||
> | ||
> (mdx | ||
> (libraries public_lib)) | ||
> EOF | ||
|
||
$ touch README.md | ||
|
||
$ cat > public_lib.ml << EOF | ||
> let foo bar = bar + 1 | ||
> EOF | ||
|
||
$ cat > test.c << EOF | ||
> int add(int a, int b) { | ||
> return a + b; | ||
> } | ||
> EOF | ||
|
||
$ dune runtest | ||
File "dune", lines 14-15, characters 0-29: | ||
14 | (mdx | ||
15 | (libraries public_lib)) | ||
Fatal error: cannot load shared library dlltest | ||
Reason: dlltest.so: cannot open shared object file: No such file or directory | ||
[1] |