On Thu, 13 Apr 2023 at 04:51, Rae Moar rmoar@google.com wrote:
On Tue, Apr 11, 2023 at 12:01 PM Michal Wajdeczko michal.wajdeczko@intel.com wrote:
Use of parameterized testing is documented [1] but such use case is not present in demo kunit test. Add small subtest for that.
[1] https://kernel.org/doc/html/latest/dev-tools/kunit/usage.html#parameterized-...
Signed-off-by: Michal Wajdeczko michal.wajdeczko@intel.com Cc: David Gow davidgow@google.com
Hello!
This looks all pretty good to me! I only have one comment. In the KTAP output:
KTAP version 1 # Subtest: example_params_test # example_params_test: initializing ok 1 example value 2 # example_params_test: initializing ok 2 example value 1 # example_params_test: initializing ok 3 example value 0 # SKIP unsupported param value # example_params_test: pass:2 fail:0 skip:1 total:3 ok 6 example_params_test
The init method is causing the "# example_params_test: initializing" to print lines for each case. However, since they are not inline with the correct indentation and they don't include helpful test data, I would consider finding a way to remove these.
I think this is probably a problem for the kunit_log() infrastructure, rather than init functions in general.
I'm not worried about them in relation to this particular test.
We could consider removing these lines from the test suite as a whole. However, they are helpful in that they show how to use the init function. Maybe check if the test is a param test case in the init function itself? Let me know what you think.
I'd rather keep these as-is: the idea is to have a very simple example of an init function, and complicating further by checking which test is running is needless complexity, IMO.
-- David