diff --git a/CHANGES.md b/CHANGES.md index b72e2efa..d82e1b93 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,9 @@ next now allowed in toplevel position in the workspace file, or for individual contexts. This feature requires `(dune lang 1.1)` (#1038, @rgrinberg) +- Add ``enabled_if`` field for aliases and tests. This field controls whether + the test will be ran using a boolean expression language. (#819, @rgrinberg) + 1.0.1 (19/07/2018) ------------------ diff --git a/doc/dune-files.rst b/doc/dune-files.rst index 5cdfe664..9ed1feb4 100644 --- a/doc/dune-files.rst +++ b/doc/dune-files.rst @@ -569,6 +569,10 @@ The syntax is as follows: - ``(locks ())`` specify that the action must be run while holding the following locks. See the `Locks`_ section for more details. +- ``(enabled_if )`` specifies the boolean condition that must + be true for the tests to run. The condition is specified using the blang_, and + the field allows for variables_ to appear in the expressions. + The typical use of the ``alias`` stanza is to define tests: .. code:: scheme @@ -824,6 +828,36 @@ doesn't start by `-`, you can simply quote it: ``("x" y z)``. Most fields using the ordered set language also support `Variables expansion`_. Variables are expanded after the set language is interpreted. +.. _blang: + +Boolean Language +---------------- + +The boolean language allows the user to define simple boolean expressions that +dune can evaluate. Here's a semi formal specification of the language: + +.. code:: + + op := '=' | '<' | '>' | '<>' | '>=' | '<=' + + expr := (and +) + | (or +) + | (