| 1 |
This checks that generated sites files correctly substituted with `dune install`. |
| 2 |
|
| 3 |
See #10317. |
| 4 |
|
| 5 |
$ cat > dune-project << EOF |
| 6 |
> (lang dune 3.0) |
| 7 |
> (using dune_site 0.1) |
| 8 |
> (package |
| 9 |
> (name a) |
| 10 |
> (sites (share data))) |
| 11 |
> EOF |
| 12 |
|
| 13 |
$ cat > dune << EOF |
| 14 |
> (library |
| 15 |
> (public_name a) |
| 16 |
> (libraries dune-site)) |
| 17 |
> (generate_sites_module |
| 18 |
> (module s) |
| 19 |
> (sites a)) |
| 20 |
> EOF |
| 21 |
|
| 22 |
$ dune build |
| 23 |
|
| 24 |
$ check_placeholder() { |
| 25 |
> name=$1; |
| 26 |
> if grep -q DUNE_PLACEHOLDER "$name"; then |
| 27 |
> echo placeholder found in $name |
| 28 |
> fi |
| 29 |
> } |
| 30 |
|
| 31 |
The generated module has placeholders. |
| 32 |
|
| 33 |
$ check_placeholder _build/default/S.ml |
| 34 |
placeholder found in _build/default/S.ml |
| 35 |
|
| 36 |
$ dune install a --prefix out/ --datadir /nonexistent/data |
| 37 |
|
| 38 |
We expect no placeholders to be present after installation. |
| 39 |
|
| 40 |
$ find out -type f | sort | while read f ; do check_placeholder $f ; done |