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.

Signed-off-by: Mark Brown <[email protected]>
---
Mark (8):
      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: wm_adsp: Give the firmware search order KUnit cases distinct names

Mark Brown (1):
      ASoC: cs35l56: Give the speaker ID pad config 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: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
change-id: 20261012-kunit-param-names-d6cb1450c3ce

Best regards,
--  
Mark Brown <[email protected]>


Reply via email to