From b7da6981288068aeed6af249f15f9e170537aeb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ojeda=20B=C3=A4r?= Date: Tue, 4 Aug 2020 21:59:56 +0200 Subject: [PATCH] Add test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolás Ojeda Bär --- .../test-cases/ocaml-syntax.t/run.t | 17 +++++++++++++++++ .../test-cases/subdir-stanza.t/run.t | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/test/blackbox-tests/test-cases/ocaml-syntax.t/run.t b/test/blackbox-tests/test-cases/ocaml-syntax.t/run.t index cf9418044cef..bdf50d0ac0a9 100644 --- a/test/blackbox-tests/test-cases/ocaml-syntax.t/run.t +++ b/test/blackbox-tests/test-cases/ocaml-syntax.t/run.t @@ -1,2 +1,19 @@ $ dune runtest --force ocaml syntax + +Check that (include ...) works when generated using OCaml syntax. + + $ mkdir -p foo && cd foo + $ cat >dune-project < (lang dune 2.5) + > EOF + $ cat >dune < (* -*- tuareg -*- *) + > let () = Jbuild_plugin.V1.send {|(include dune.inc)|} + > EOF + $ cat >dune.inc < (rule (with-stdout-to foo.txt (echo Hola!))) + > EOF + $ dune build --root . ./foo.txt + $ cat _build/default/foo.txt + Hola! diff --git a/test/blackbox-tests/test-cases/subdir-stanza.t/run.t b/test/blackbox-tests/test-cases/subdir-stanza.t/run.t index f7e8f79b49c2..b7f41018f25a 100644 --- a/test/blackbox-tests/test-cases/subdir-stanza.t/run.t +++ b/test/blackbox-tests/test-cases/subdir-stanza.t/run.t @@ -72,3 +72,21 @@ In conjunction with dune generated files: $ dune build ./sub/bar $ cat _build/default/sub/bar parent + +subdir stanzas can also appear in included files + + $ mkdir -p include/subdir; cd include + $ cat >dune-project < (lang dune 2.5) + > EOF + $ cat >dune < (include dune.inc) + > EOF + $ cat >dune.inc < (subdir subdir + > (rule + > (action (with-stdout-to hello.txt (echo "Hello from subdir\n"))))) + > EOF + $ dune build --root . subdir/hello.txt + $ cat _build/default/subdir/hello.txt + Hello from subdir