patch 'buildtools/test: scan muti-line registrations' has been queued to stable release 23.11.5

Xueming Li xuemingl at nvidia.com
Wed Jul 30 09:10:18 CEST 2025


Hi,

FYI, your patch has been queued to stable release 23.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/10/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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging

This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=49f854ce6d8b228be864cdff1c66502e9760d9b5

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 49f854ce6d8b228be864cdff1c66502e9760d9b5 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
Cc: Xueming Li <xuemingl at nvidia.com>

[ 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
@@ -6,10 +6,12 @@ import sys
 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 = []
 
 def get_fast_test_params(test_name, ln):
@@ -20,19 +22,19 @@ 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:
             test_suites[suite_name].append(test_name)
         else:
             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():
     print(f"{suite}={','.join(test_suites[suite])}")
-- 
2.34.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-07-30 15:02:13.047698168 +0800
+++ 0007-buildtools-test-scan-muti-line-registrations.patch	2025-07-30 15:02:12.771184135 +0800
@@ -1 +1 @@
-From 778688b445e1d42e2e30cca29c0301dc94f32af5 Mon Sep 17 00:00:00 2001
+From 49f854ce6d8b228be864cdff1c66502e9760d9b5 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 778688b445e1d42e2e30cca29c0301dc94f32af5 ]
@@ -20 +22,0 @@
-Cc: stable at dpdk.org


More information about the stable mailing list