patch 'buildtools/test: scan muti-line registrations' has been queued to stable release 24.11.3
Kevin Traynor
ktraynor at redhat.com
Fri Jul 18 21:30:50 CEST 2025
Hi,
FYI, your patch has been queued to stable release 24.11.3
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/23/25. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/2e783994260f5efde0d19ebc383bb16357698cef
Thanks.
Kevin
---
>From 2e783994260f5efde0d19ebc383bb16357698cef Mon Sep 17 00:00:00 2001
From: Marat Khalili <marat.khalili at huawei.com>
Date: Wed, 18 Jun 2025 13:39:46 +0100
Subject: [PATCH] buildtools/test: scan muti-line registrations
[ upstream commit 778688b445e1d42e2e30cca29c0301dc94f32af5 ]
Test list is currently generated by scanning all files for macros
starting with `REGISTER_` and ending with `_TEST`. Unfortunately, this
was done line-by-line, and macros split into several lines were silently
ignored resulting in tests being excluded from test suites without any
warning.
Make regular expression multiline, capturing everything until the
closing parenthesis. (There should be no nested parentheses due to the
nature of the arguments these macros accept.)
The rest of the functionality stays the same. The result was manually
compared to be identical to the previous version.
Fixes: 0aeaf75df879 ("test: define unit tests suites based on test types")
Signed-off-by: Marat Khalili <marat.khalili at huawei.com>
---
buildtools/get-test-suites.py | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/buildtools/get-test-suites.py b/buildtools/get-test-suites.py
index fd22d25f36..c3a99a862e 100644
--- a/buildtools/get-test-suites.py
+++ b/buildtools/get-test-suites.py
@@ -7,8 +7,10 @@ import re
input_list = sys.argv[1:]
-test_def_regex = re.compile(r"REGISTER_([A-Z]+)_TEST\s*\(\s*([a-z0-9_]+)")
+test_def_regex = re.compile(
+ r"^\s*REGISTER_([A-Z]+)_TEST\s*\(\s*([a-z0-9_]+)[^)]*\)", re.MULTILINE)
test_suites = {}
# track tests not in any test suite.
-non_suite_regex = re.compile(r"REGISTER_TEST_COMMAND\s*\(\s*([a-z0-9_]+)")
+non_suite_regex = re.compile(
+ r"^\s*REGISTER_TEST_COMMAND\s*\(\s*([a-z0-9_]+)[^)]*\)", re.MULTILINE)
non_suite_tests = []
@@ -21,10 +23,9 @@ def get_fast_test_params(test_name, ln):
for fname in input_list:
with open(fname, "r", encoding="utf-8") as f:
- contents = [ln.strip() for ln in f.readlines()]
- test_lines = [ln for ln in contents if test_def_regex.match(ln)]
- non_suite_tests.extend([non_suite_regex.match(ln).group(1)
- for ln in contents if non_suite_regex.match(ln)])
- for ln in test_lines:
- (test_suite, test_name) = test_def_regex.match(ln).group(1, 2)
+ contents = f.read()
+ non_suite_tests.extend(
+ match.group(1) for match in non_suite_regex.finditer(contents))
+ for match in test_def_regex.finditer(contents):
+ (test_suite, test_name) = match.group(1, 2)
suite_name = f"{test_suite.lower()}-tests"
if suite_name in test_suites:
@@ -33,5 +34,6 @@ for fname in input_list:
test_suites[suite_name] = [test_name]
if suite_name == "fast-tests":
- test_suites["fast-tests"][-1] += get_fast_test_params(test_name, ln)
+ test_suites["fast-tests"][-1] += get_fast_test_params(
+ test_name, match.group(0))
for suite in test_suites.keys():
--
2.50.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-07-18 20:29:15.058408970 +0100
+++ 0116-buildtools-test-scan-muti-line-registrations.patch 2025-07-18 20:29:11.055907714 +0100
@@ -1 +1 @@
-From 778688b445e1d42e2e30cca29c0301dc94f32af5 Mon Sep 17 00:00:00 2001
+From 2e783994260f5efde0d19ebc383bb16357698cef Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 778688b445e1d42e2e30cca29c0301dc94f32af5 ]
+
@@ -20 +21,0 @@
-Cc: stable at dpdk.org
More information about the stable
mailing list