On Tue, Oct 12, 2021 at 1:27 PM Daniel Latypov dlatypov@google.com wrote:
On Mon, Oct 11, 2021 at 9:38 PM David Gow davidgow@google.com wrote:
On Mon, Oct 11, 2021 at 10:10 AM Jeremy Kerr jk@codeconstruct.com.au wrote:
Hi David,
In any case, thanks a lot -- this is awesome.
Oh neat, glad it's useful!
+1
I'm happy to keep hacking on this if it's in a direction that makes sense for kunit in general. As an approximate plan, I can fix the UML breakages, then work on some resulting simplifications for tree-wide initialisers (we'd no longer need the null-terminated arrays of suites everywhere, for example).
Getting rid of the arrays of arrays of suites sounds great to me.
I could also pick that bit up, since I'm the person who most recently added code that depends on it: https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/co...
I made the executor internally flatten the array-of-arrays into just an array to flush out the changes we'd need to make. I've sent that here: https://lore.kernel.org/linux-kselftest/20211013191320.2490913-1-dlatypov@go...
After doing it and seeing the diffstat (2 files changed, 85 insertions(+), 178 deletions(-)), I'm actually tempted to have that go in as an actual patch.
When we rework the kunit_test_suites section, we could then just drop the flattening helper function.
+dlatypov, +kunit-dev
Yeah, we think this would be a much better direction for KUnit to go for modules. If you're happy to work on it, that'd be great! Brendan, Daniel (CCed), and I would be more than willing to help out with questions, reviews, etc, as well.
On the other hand, if you're really busy and you'd rather we pick this up, improved module support has been on the to-do list for ages, so we could bump it up the list a bit and finish it off.
The UML breakages were mostly pretty simple: our default config doesn't require module support at all, so the various functions should just need to go behind the appropriate #ifdefs. A quick way to test it is just to run './tools/testing/kunit/kunit.py run' from the kernel source directory, which will configure, build, and run everything in the .kunit builddir.
Cheers, -- David