Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions test/blackbox-tests/test-cases/meta-file/promoted-template.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
A promoted META file template may have a source counterpart that differs from
the rule output. The generated contents are currently accepted.

$ make_dune_project_with_package 2.7 promoted

$ cat >promoted.ml <<EOF
> let foo () = ()
> EOF

$ cat >META.promoted.template <<EOF
> # DUNE_GEN
> EOF

$ cat >dune <<'EOF'
> (library
> (public_name promoted))
>
> (rule
> (target META.promoted.template)
> (mode promote)
> (action
> (write-file %{target} "package \"broken\" @")))
> EOF

$ dune build @install --disable-promotion

The source remains valid, while the generated template and final META contain
the malformed rule output.

$ printf '# DUNE_GEN\n' | cmp - META.promoted.template
$ printf 'package "broken" @' | cmp - _build/default/META.promoted.template
$ printf 'package "broken" @' | cmp - _build/default/META.promoted
Loading