test: Rename all linker lists to have a ut_ prefix
authorSimon Glass <sjg@chromium.org>
Mon, 8 Mar 2021 00:35:11 +0000 (17:35 -0700)
committerTom Rini <trini@konsulko.com>
Fri, 12 Mar 2021 14:57:30 +0000 (09:57 -0500)
At present each test suite has its own portion of the linker_list section
of the image, but other lists are interspersed. This makes it hard to
enumerate all the available tests without knowing the suites that each one
is in.

Place all tests together in a single contiguous list by giving them
common prefix not used elsewhere in U-Boot. This makes it possible to find
the start and end of all tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
include/test/test.h
test/py/conftest.py

index b16c913..3330dcc 100644 (file)
@@ -86,18 +86,18 @@ struct unit_test {
  * @_suite:    name of the test suite concatenated with "_test"
  */
 #define UNIT_TEST(_name, _flags, _suite)                               \
-       ll_entry_declare(struct unit_test, _name, _suite) = {           \
+       ll_entry_declare(struct unit_test, _name, ut_ ## _suite) = {    \
                .file = __FILE__,                                       \
                .name = #_name,                                         \
                .flags = _flags,                                        \
                .func = _name,                                          \
        }
 
-/* Get the start of a list of unit tests for a particular category */
+/* Get the start of a list of unit tests for a particular suite */
 #define UNIT_TEST_SUITE_START(_suite) \
-       ll_entry_start(struct unit_test, _suite)
+       ll_entry_start(struct unit_test, ut_ ## _suite)
 #define UNIT_TEST_SUITE_COUNT(_suite) \
-       ll_entry_count(struct unit_test, _suite)
+       ll_entry_count(struct unit_test, ut_ ## _suite)
 
 /* Sizes for devres tests */
 enum {
index 9bfd926..1b909cd 100644 (file)
@@ -226,7 +226,7 @@ def pytest_configure(config):
         import u_boot_console_exec_attach
         console = u_boot_console_exec_attach.ConsoleExecAttach(log, ubconfig)
 
-re_ut_test_list = re.compile(r'_u_boot_list_2_(.*)_test_2_\1_test_(.*)\s*$')
+re_ut_test_list = re.compile(r'_u_boot_list_2_ut_(.*)_test_2_\1_test_(.*)\s*$')
 def generate_ut_subtest(metafunc, fixture_name, sym_path):
     """Provide parametrization for a ut_subtest fixture.