Skip to contentSkip to conversation

lib/tests: util_macros: Drop the '.' from the KUnit suite name

PATCH New Mark 1 participant 1 message Oct 12 Kselftest

lore
Share & tools
lore

Mark

author
#0 lore raw

PATCH 1/1 lib/tests: util_macros: Drop the '.' from the KUnit suite name

The util_macros KUnit suite is named "util_macros.h". KUnit test names are formed as "<suite>.<test>" and a '.' in the suite name makes them ambiguous, which breaks every consumer that splits on it:

- kunit.filter_glob= splits on the first '.', so kunit.filter_glob=util_macros.h is parsed as suite "util_macros" with test glob "h" and matches nothing.

- kunit.py's --list_tests output parser only accepts "<suite>.<test>" names with a single '.', so the suite's tests are dropped from the list and the suite name line "util_macros.h" is mistaken for a test called "h" in suite "util_macros".

- As a result kunit.py --run_isolated=suite boots a kernel with kunit.filter_glob=util_macros, which runs nothing and reports an error, while the suite's actual tests are never run.

Rename the suite to "util_macros" to match the other lib/tests suites.

---
Cc: [email protected]
To: Brendan Higgins <[email protected]>
To: David Gow <[email protected]>
To: Rae Moar <[email protected]>
To: [email protected]
To: [email protected]

---
 lib/tests/util_macros_kunit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/tests/util_macros_kunit.c +1 -1
index 94cc9f0de50a..73652a6872c3 100644
@@ -229,7 +229,7 @@ static struct kunit_case __refdata util_macros_test_cases[] = {
 };
 
 static struct kunit_suite util_macros_test_suite = {
-	.name = "util_macros.h",
+	.name = "util_macros",
 	.test_cases = util_macros_test_cases,
 };
 

---
base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
change-id: 20261012-kunit-util-macros-name-7f490d9f0ffd

Best regards,

Signature · 1 line
Mark Brown <[email protected]>