[PATCH v2 2/5] kunit: flatten kunit_suite*** to kunit_suite** in .kunit_test_suites

Daniel Latypov dlatypov at google.com
Wed Jun 22 06:29:24 AEST 2022


On Tue, Jun 21, 2022 at 1:54 AM 'David Gow' via KUnit Development
<kunit-dev at googlegroups.com> wrote:
>
> From: Daniel Latypov <dlatypov at google.com>
>
> We currently store kunit suites in the .kunit_test_suites ELF section as
> a `struct kunit_suite***` (modulo some `const`s).
> For every test file, we store a struct kunit_suite** NULL-terminated array.
>
> This adds quite a bit of complexity to the test filtering code in the
> executor.
>
> Instead, let's just make the .kunit_test_suites section contain a single
> giant array of struct kunit_suite pointers, which can then be directly
> manipulated. This array is not NULL-terminated, and so none of the test
> filtering code needs to NULL-terminate anything.
>
> Tested-by: Maíra Canal <maira.canal at usp.br>
> Signed-off-by: Daniel Latypov <dlatypov at google.com>
> Co-developed-by: David Gow <davidgow at google.com>
> Signed-off-by: David Gow <davidgow at google.com>
> ---
>
> Changes since v1:
> https://lore.kernel.org/linux-kselftest/20220618090310.1174932-3-davidgow@google.com/
> - No longer NULL-terminate generated suite_sets

Nice!
Thanks for picking and cleaning this up!

Daniel


More information about the Linux-aspeed mailing list