From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= Date: Sun, 7 Mar 2021 05:25:08 +0100 Subject: [PATCH u-boot 09/39] test/py: improve regular expression for ut subtest symbol matcher In-Reply-To: <20210307042538.21229-1-marek.behun@nic.cz> References: <20210307042538.21229-1-marek.behun@nic.cz> Message-ID: <20210307042538.21229-10-marek.behun@nic.cz> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Improve the regular expression that matches unittest symbols in u-boot.sym. Currently we do not enforce no prefix in symbol string, but with the soon to come change in linker lists declaring lists and entries with the __ADDRESSABLE macro (because of LTO), the symbol file will contain for every symbol of the form _u_boot_list_2_X_2_Y also symbol __UNIQUE_ID___addressable__u_boot_list_2_X_2_YN, (where N at the end is some number). In order to avoid matching these additional symbols, ensure that the character before "_u_boot_list_2" is not a symbol name character. Signed-off-by: Marek Beh?n --- test/py/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/py/conftest.py b/test/py/conftest.py index 9bfd926345..3ea3fa5220 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -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'[^a-zA-Z0-9_]_u_boot_list_2_(.*)_test_2_\1_test_(.*)\s*$') def generate_ut_subtest(metafunc, fixture_name, sym_path): """Provide parametrization for a ut_subtest fixture. -- 2.26.2