[PATCH v2 01/10] app/test: make parameters clearer when adding fast tests
Marat Khalili
marat.khalili at huawei.com
Fri Dec 5 11:10:34 CET 2025
Apart from one cosmetic issue in a comment,
Acked-by: Marat Khalili <marat.khalili at huawei.com>
> diff --git a/app/test/suites/meson.build b/app/test/suites/meson.build
> index 712dd65568..65995078b7 100644
> --- a/app/test/suites/meson.build
> +++ b/app/test/suites/meson.build
> @@ -67,9 +67,19 @@ foreach suite:test_suites
> # special fast-test handling here
> foreach t: suite_tests
> params = t.split(':')
> + # check for valid options for asan and nohuge. Note, the extraction script runs tolower()
> diff --git a/buildtools/get-test-suites.py b/buildtools/get-test-suites.py
> index c3a99a862e..73f1d9c9e1 100644
> --- a/buildtools/get-test-suites.py
> +++ b/buildtools/get-test-suites.py
> @@ -18,7 +18,7 @@ def get_fast_test_params(test_name, ln):
> "Extract the extra fast-test parameters from the line"
> (_, rest_of_line) = ln.split(test_name, 1)
> (_, nohuge, asan, _func) = rest_of_line.split(',', 3)
> - return f":{nohuge.strip().lower()}:{asan.strip().lower()}"
> + return f":{nohuge.strip()}:{asan.strip()}"
Is the Note above no longer relevant?
>
> for fname in input_list:
> with open(fname, "r", encoding="utf-8") as f:
> diff --git a/doc/guides/contributing/unit_test.rst b/doc/guides/contributing/unit_test.rst
> index c0f0d2988f..0c76921299 100644
> --- a/doc/guides/contributing/unit_test.rst
> +++ b/doc/guides/contributing/unit_test.rst
> @@ -188,9 +188,11 @@ There are two important functions for interacting with the test harness:
> The test is automatically added to the Meson test suite `<MESON_SUITE>` by this macro.
> Examples would be ``REGISTER_DRIVER_TEST``, or ``REGISTER_PERF_TEST``.
> **NOTE:** The ``REGISTER_FAST_TEST`` macro is slightly different,
> - in that it takes two additional parameters,
> - specifying whether the test can be run using ``--no-huge``,
> - and whether the test can be run using Address Sanitization (ASAN)
> + in that it takes two additional parameters before the function name:
> + the hugepage requirement (``NOHUGE_OK`` if the test can run without hugepages,
> + or ``NOHUGE_SKIP`` if hugepages are required),
> + and Address Sanitizer compatibility (``ASAN_OK`` if the test can run with ASan enabled,
> + or ``ASAN_SKIP`` if it cannot).
>
> ``unit_test_suite_runner(struct unit_test_suite *)``
> Returns a runner for a full test suite object,
> @@ -318,7 +320,7 @@ of the unit test suite structure, for example:
> return ret;
> }
>
> - REGISTER_FAST_TEST(example_autotest, true /*no-huge*/, false /*ASan*/, example_tests);
> + REGISTER_FAST_TEST(example_autotest, NOHUGE_OK, ASAN_OK, example_tests);
I support change of this example meaning to what should be the default.
More information about the dev
mailing list