This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,17 @@
Demonstrate that it's not possible to generate the (dirs ..) stanza using the
dune syntax.
$ cat >dune-project <<EOF
> (lang dune 2.7)
> EOF
$ cat >dune <<EOF
> (* -*- tuareg -*- *)
> let () = Jbuild_plugin.V1.send {|(dirs foo)|}
> EOF
$ dune build
File "_build/.dune/default/dune", line 1, characters 0-10:
1 | (dirs foo)
^^^^^^^^^^
Error: stanza "dirs" may not appear in (include ..) or be generated with
OCaml syntax dune files
[1]

View file

@ -0,0 +1,14 @@
When `-x` is passed and a dune file in OCaml syntax is loaded, we should not
crash.
See #9239.
$ cat > dune-project << EOF
> (lang dune 1.0)
> EOF
$ cat > dune << EOF
> (* -*- tuareg -*- *)
> let () = Jbuild_plugin.V1.send ""
> EOF
$ dune build -x cross

View file

@ -0,0 +1,7 @@
(* -*- tuareg -*- *)
let () = Jbuild_plugin.V1.send {|
(alias
(name runtest)
(action (echo "ocaml syntax")))
|}

View file

@ -0,0 +1,19 @@
$ dune runtest --force
ocaml syntax
Check that (include ...) works when generated using OCaml syntax.
$ mkdir -p foo && cd foo
$ cat >dune-project <<EOF
> (lang dune 2.5)
> EOF
$ cat >dune <<EOF
> (* -*- tuareg -*- *)
> let () = Jbuild_plugin.V1.send {|(include dune.inc)|}
> EOF
$ cat >dune.inc <<EOF
> (rule (with-stdout-to foo.txt (echo Hola!)))
> EOF
$ dune build --root . ./foo.txt
$ cat _build/default/foo.txt
Hola!