Skip to content

kunit: Add KUNIT_CASE_PARAM_UNIQUE() and KUNIT_CASE_PARAM_WITH_INIT_UNIQUE()

Mark Brown linux-doc linux-ext4 linux-kselftest linux-sound lkml 2 versions – In review

Get series with b4
b4 am [email protected] change-id 20261012-kunit-param-names-d6cb1450c3ce

Versions newest first

  1. v2 Latest9 patches 10 repliesIn review
  2. v19 patches 7 repliesSuperseded

Changes in v2 from the cover letter

- Rebase onto v7.4-rc1.
- Link to v1: https://patch.msgid.link/[email protected]

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9firmware: cs_dsp: Run the wmfw payload error tests with invalid block typesdrivers/firmware/cirrus/test/cs_dsp_test_wmfw_error.c+8 -81 reply
2/9kunit: Add KUNIT_CASE_PARAM_UNIQUE() and KUNIT_CASE_PARAM_WITH_INIT_UNIQUE()Documentation/dev-tools/kunit/usage.rst include/kunit/test.h+50 -01 reply
3/9ext4: Give the extents KUnit cases distinct namesfs/ext4/extents-test.c+6 -62 replies
4/9firmware: cs_dsp: Give the control read/write KUnit cases distinct namesdrivers/firmware/cirrus/test/cs_dsp_test_control_rw.c+26 -241 reply
5/9firmware: cs_dsp: Give the control cache KUnit cases distinct namesdrivers/firmware/cirrus/test/cs_dsp_test_control_cache.c+72 -711 reply
6/9firmware: cs_dsp: Give the wmfw block error KUnit cases distinct namesdrivers/firmware/cirrus/test/cs_dsp_test_wmfw_error.c+48 -241 reply
7/9firmware: cs_dsp: Give the bin file KUnit cases distinct namesdrivers/firmware/cirrus/test/cs_dsp_test_bin.c+111 -1111 reply
8/9ASoC: cs35l56: Give the speaker ID pad config KUnit cases distinct namessound/soc/codecs/cs35l56-shared-test.c+4 -41 reply
9/9ASoC: wm_adsp: Give the firmware search order KUnit cases distinct namessound/soc/codecs/wm_adsp_fw_find_test.c+12 -121 reply

Reviews trailers per patch

All 9 patches have a Reviewed-by or Acked-by.

PatchRichard FitzgeraldDavid Gow
1/9R-b A-b
2/9R-b
3/9A-b
4/9R-b A-b
5/9R-b A-b
6/9R-b A-b
7/9R-b A-b
8/9R-b A-b
9/9R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/9] kunit: Add KUNIT_CASE_PARAM_UNIQUE() and KUNIT_CASE_PARAM_WITH_INIT_UNIQUE()

KUNIT_CASE_PARAM() and KUNIT_CASE_PARAM_WITH_INIT() name the test case after the test function. Several suites reuse one test function with more than one parameter generator or param_init() function, listing it once per set of parameters, which leads to multiple tests being created with the same name. Same-named cases cannot be told apart in the results and cannot be selected individually with kunit.filter_glob=, so kunit.py --run_isolated=test boots a kernel for every entry and each kernel runs all of the same-named cases.

We could fix this by having the KUNIT_CASE_PARAM() macros always include the parameter name but this would not only rename all existing users but also result in some awkwardly named tests. Instead introduce some new macros for use in cases where we need to disambiguate.

Add KUNIT_CASE_PARAM_UNIQUE() and KUNIT_CASE_PARAM_WITH_INIT_UNIQUE() which behave identically to the existing macros but include the name of the parameter generator or the param_init() function in the name of the case, giving names such as sha1_test-sha1_gen_params. The param_init() function is used for the WITH_INIT variant since currently all the tests which register parameter arrays from param_init() all share the generic kunit_array_gen_params() generator.

The series also includes a fix for what looks like a cut'n'paste issue in the cs_dsp code that overlaps with the main set of changes. Most of the affected tests are in ASoC, though there are some ext4 tests too.

---
Changes in v2:
- Rebase onto v7.4-rc1.
- Link to v1: https://patch.msgid.link/[email protected]

---
Mark Brown (9):
firmware: cs_dsp: Run the wmfw payload error tests with invalid block types
kunit: Add KUNIT_CASE_PARAM_UNIQUE() and KUNIT_CASE_PARAM_WITH_INIT_UNIQUE()
ext4: Give the extents KUnit cases distinct names
firmware: cs_dsp: Give the control read/write KUnit cases distinct names
firmware: cs_dsp: Give the control cache KUnit cases distinct names
firmware: cs_dsp: Give the wmfw block error KUnit cases distinct names
firmware: cs_dsp: Give the bin file KUnit cases distinct names
ASoC: cs35l56: Give the speaker ID pad config KUnit cases distinct names
ASoC: wm_adsp: Give the firmware search order KUnit cases distinct names

 Documentation/dev-tools/kunit/usage.rst            |   9 +
 drivers/firmware/cirrus/test/cs_dsp_test_bin.c     | 222 ++++++++++-----------
 .../cirrus/test/cs_dsp_test_control_cache.c        | 143 ++++++-------
 .../firmware/cirrus/test/cs_dsp_test_control_rw.c  |  50 ++---
 .../firmware/cirrus/test/cs_dsp_test_wmfw_error.c  |  72 ++++---
 fs/ext4/extents-test.c                             |  12 +-
 include/kunit/test.h                               |  41 ++++
 sound/soc/codecs/cs35l56-shared-test.c             |   8 +-
 sound/soc/codecs/wm_adsp_fw_find_test.c            |  24 +--
 9 files changed, 329 insertions(+), 252 deletions(-)

---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm master
change-id: 20261012-kunit-param-names-d6cb1450c3ce

Best regards,

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