Skip to content

Commit

Permalink
test(melange): demonstrate melange.emit doesn't respect -p
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
  • Loading branch information
anmonteiro committed Jun 1, 2023
1 parent d4ceaa9 commit 53640ad
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions test/blackbox-tests/test-cases/melange/melange-emit-package.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

$ mkdir lib test ppx
$ cat > dune-project <<EOF
> (lang dune 3.8)
> (package (name my-ppx))
> (package (name mel-foo))
> (using melange 0.1)
> EOF

$ cat > ppx/dune <<EOF
> (library
> (name my_ppx)
> (public_name my-ppx))
> EOF
$ touch ppx/my_ppx.ml

$ cat > lib/dune <<EOF
> (library
> (public_name mel-foo)
> (name mel_foo)
> (modes melange)
> (preprocess (pps melange.ppx)))
> EOF
$ cat > lib/mel_foo.ml <<EOF
> let x = "lib"
> EOF

$ cat > test/dune <<EOF
> (melange.emit
> (package mel-foo)
> (target js-out)
> (libraries mel-foo))
> EOF

`melange.emit` is attached to the package `mel-foo`, so it shouldn't be built
when building the other library

$ dune build -p my-ppx
File "test/dune", line 4, characters 12-19:
4 | (libraries mel-foo))
^^^^^^^
Error: Library "mel-foo" not found.
[1]

0 comments on commit 53640ad

Please sign in to comment.