diff --git a/CHANGES.md b/CHANGES.md index 2d3f851868d0..5d4f6dd8678b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,7 +8,7 @@ - Do not put the `.install` files in the source tree unless `-p` or `--promote-install-files` is passed on the command line (#2329, @diml) -- Add a new `inline-tests` field in the env stanza to control inline-tests +- Add a new `inline_tests` field in the env stanza to control inline_tests framework with a variable (#2313, @mlasson review and original idea by @diml) - Change `implicit_transive_deps` to be false. Implicit transitive deps now must diff --git a/doc/dune-files.rst b/doc/dune-files.rst index 5fa85aafee46..0057b33d1f37 100644 --- a/doc/dune-files.rst +++ b/doc/dune-files.rst @@ -814,8 +814,8 @@ Fields supported in ```` are: be inferred from the basename of ```` by dropping the ``.exe`` suffix if it exists. -- ``(inline-tests )`` where state is either ``enabled``, ``disabled`` or - ``ignored``. This field controls the value of the variable ``%{inline-tests}`` +- ``(inline_tests )`` where state is either ``enabled``, ``disabled`` or + ``ignored``. This field controls the value of the variable ``%{inline_tests}`` that is read by the inline test framework. The default value is ``disabled`` for the ``release`` profile and ``enabled`` otherwise. diff --git a/src/dune_env.ml b/src/dune_env.ml index 1758f71f4ca9..6dcc8df4e210 100644 --- a/src/dune_env.ml +++ b/src/dune_env.ml @@ -52,7 +52,7 @@ module Stanza = struct let inline_tests_field = field_o - "inline-tests" + "inline_tests" (Syntax.since Stanza.syntax (1, 11) >>> Inline_tests.decode) diff --git a/src/super_context.ml b/src/super_context.ml index 3b3767164422..02a3da423366 100644 --- a/src/super_context.ml +++ b/src/super_context.ml @@ -186,7 +186,7 @@ end = struct inline_tests t ~dir |> Dune_env.Stanza.Inline_tests.to_string in - Pform.Map.singleton "inline-tests" (Values [String str]) + Pform.Map.singleton "inline_tests" (Values [String str]) in expander |> Expander.add_bindings ~bindings diff --git a/test/blackbox-tests/test-cases/inline_tests/simple/dune b/test/blackbox-tests/test-cases/inline_tests/simple/dune index 0a1b293f529c..bd1aa94dee00 100644 --- a/test/blackbox-tests/test-cases/inline_tests/simple/dune +++ b/test/blackbox-tests/test-cases/inline_tests/simple/dune @@ -2,7 +2,7 @@ (name backend_simple) (modules ()) (inline_tests.backend - (generate_runner (run sed "s/(\\*TEST:\\(.*\\)\\*)/let () = if \"%{inline-tests}\" = \"enabled\" then \\1;;/" %{impl-files}) + (generate_runner (run sed "s/(\\*TEST:\\(.*\\)\\*)/let () = if \"%{inline_tests}\" = \"enabled\" then \\1;;/" %{impl-files}) ))) (library