Skip to content

Commit

Permalink
test: sites modules substitution with dune install (ocaml#10326)
Browse files Browse the repository at this point in the history
Repro for ocaml#10317

Signed-off-by: Etienne Millon <[email protected]>
  • Loading branch information
emillon authored and Philip White committed Apr 2, 2024
1 parent f266df1 commit ec5fd93
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions otherlibs/dune-site/test/install-subst.t
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

0 comments on commit ec5fd93

Please sign in to comment.