forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: sites modules substitution with dune install (ocaml#10326)
Repro for ocaml#10317 Signed-off-by: Etienne Millon <[email protected]>
- Loading branch information
Showing
1 changed file
with
44 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,44 @@ | ||
This checks that generated sites files correctly substituted with `dune install`. | ||
|
||
See #10317. | ||
|
||
$ cat > dune-project << EOF | ||
> (lang dune 3.0) | ||
> (using dune_site 0.1) | ||
> (package | ||
> (name a) | ||
> (sites (share data))) | ||
> EOF | ||
|
||
$ cat > dune << EOF | ||
> (library | ||
> (public_name a) | ||
> (libraries dune-site)) | ||
> (generate_sites_module | ||
> (module s) | ||
> (sites a)) | ||
> EOF | ||
|
||
$ dune build | ||
|
||
$ check_placeholder() { | ||
> name=$1; | ||
> if grep -q DUNE_PLACEHOLDER "$name"; then | ||
> echo placeholder found in $name | ||
> fi | ||
> } | ||
|
||
The generated module has placeholders. | ||
|
||
$ check_placeholder _build/default/S.ml | ||
placeholder found in _build/default/S.ml | ||
|
||
$ dune install a --prefix out/ --datadir /nonexistent/data | ||
|
||
We expect no placeholders to be present after installation. | ||
|
||
$ find out -type f | sort | while read f ; do check_placeholder $f ; done | ||
placeholder found in out/lib/a/S.ml | ||
placeholder found in out/lib/a/a.a | ||
placeholder found in out/lib/a/a.cma | ||
placeholder found in out/lib/a/a__S.cmt |