-
Notifications
You must be signed in to change notification settings - Fork 470
an empty target for easier scripting #4161
Description
In a CI script I want to let users specify their testing targets ("@runtest" by default, but maybe it's just "@tests/fast/runtest @tests/somewhat-fast/runtest" for example), with the convention that if they give an empty string, then tests will not run at all.
Currently I write this in the following way:
if [ -n "$TEST_TARGETS" ]; then dune build $TEST_TARGETS; fi
But I would like to avoid the conditional by telling Dune: if I don't give you any target, please don't do anything. So something like dune build --dont-do-anything-by-default $TEST_TARGETS.
This is almost possible with the option dune build --default-target="..." $TEST_TARGETS, except that I have not found a way to specify a default target that does nothing. If I use a non-existing alias such as @empty there, I get an error and the build fails.
Feature request: provide an explicit target (@none or @empty for example) that successfully does nothing, so that I can use it as default target for my use-case.