Skip to content

Commit b20a615

Browse files
committed
Add tests for optional/enabled_if executables
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
1 parent bdde7c3 commit b20a615

File tree

1 file changed

+28
-0
lines changed
  • test/blackbox-tests/test-cases/optional-executable.t

1 file changed

+28
-0
lines changed

test/blackbox-tests/test-cases/optional-executable.t/run.t

+28
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,32 @@ present even if the binary is not optional.
128128
$ PATH=./bin:$PATH dune build @run-x
129129
binary path: $TESTCASE_ROOT/optional-binary-absent/./bin/dunetestbar
130130

131+
Optional on the executable should be respected:
132+
133+
$ cat >exe/dune <<EOF
134+
> (executable
135+
> (public_name dunetestbar)
136+
> (libraries does-not-exist)
137+
> (optional)
138+
> (name bar))
139+
> EOF
140+
141+
$ PATH=./bin:$PATH dune build @run-x
142+
143+
In the same way as enabled_if:
144+
145+
$ cat >exe/dune <<EOF
146+
> (executable
147+
> (public_name dunetestbar)
148+
> (enabled_if false)
149+
> (name bar))
150+
> EOF
151+
152+
$ PATH=./bin:$PATH dune build @run-x
153+
Error: No rule found for install bin/dunetestbar
154+
-> required by %{bin:dunetestbar} at dune:3
155+
-> required by alias run-x in dune:1
156+
[1]
157+
131158
$ cd ..
159+

0 commit comments

Comments
 (0)