Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolás Ojeda Bär <[email protected]>
  • Loading branch information
nojb authored and Leonidas-from-XIV committed Dec 3, 2024
1 parent 769c00a commit 2efeefc
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions test/blackbox-tests/test-cases/no_dynlink.t
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
This test checks that if a library is declared with `(no_dynlink)`, then the
corresponding `.cmxs` file is *not* built.

$ cat >dune-project <<EOF
> (lang dune 3.17)
> EOF

First we check the behaviour when `(no_dynlink)` is not present.

$ cat >dune <<EOF
> (library
> (name mylib))
> EOF

$ touch a.ml

$ dune build --display short
ocamlc .mylib.objs/byte/mylib.{cmi,cmo,cmt}
ocamldep .mylib.objs/mylib__A.impl.d
ocamlopt .mylib.objs/native/mylib.{cmx,o}
ocamlc .mylib.objs/byte/mylib__A.{cmi,cmo,cmt}
ocamlopt .mylib.objs/native/mylib__A.{cmx,o}
ocamlc mylib.cma
ocamlopt mylib.{a,cmxa}
ocamlopt mylib.cmxs
$ dune build _build/default/mylib.cmxs

Now with `(no_dynlink)`.

$ cat >dune <<EOF
> (library
Expand All @@ -27,11 +26,7 @@

$ dune clean

$ dune build --display short
ocamlc .mylib.objs/byte/mylib.{cmi,cmo,cmt}
ocamldep .mylib.objs/mylib__A.impl.d
ocamlopt .mylib.objs/native/mylib.{cmx,o}
ocamlc .mylib.objs/byte/mylib__A.{cmi,cmo,cmt}
ocamlopt .mylib.objs/native/mylib__A.{cmx,o}
ocamlc mylib.cma
ocamlopt mylib.{a,cmxa}
$ dune build _build/default/mylib.cmxs
Error: Don't know how to build _build/default/mylib.cmxs
Hint: did you mean _build/default/mylib.cma or _build/default/mylib.cmxa?
[1]

0 comments on commit 2efeefc

Please sign in to comment.