Re: [PATCH v2 linux-kselftest-test 2/3] kunit: allow kunit to be loaded as a module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/8/19 7:55 AM, Alan Maguire wrote:
> Making kunit itself buildable as a module allows for "always-on"
> kunit configuration; specifying CONFIG_KUNIT=m means the module
> is built but only used when loaded.  Kunit test modules will load
> kunit.ko as an implicit dependency, so simply running
> "modprobe my-kunit-tests" will load the tests along with the kunit
> module and run them.
> 
> Signed-off-by: Alan Maguire <alan.maguire@xxxxxxxxxx>
> Signed-off-by: Knut Omang <knut.omang@xxxxxxxxxx>
> 
> ---
>  lib/kunit/Kconfig  | 2 +-
>  lib/kunit/Makefile | 4 +++-
>  lib/kunit/test.c   | 4 ++++
>  3 files changed, 8 insertions(+), 2 deletions(-)

> diff --git a/lib/kunit/test.c b/lib/kunit/test.c
> index e7896f1..6024627 100644
> --- a/lib/kunit/test.c
> +++ b/lib/kunit/test.c
> @@ -484,3 +484,7 @@ void kunit_cleanup(struct kunit *test)
>  	}
>  }
>  EXPORT_SYMBOL_GPL(kunit_cleanup);
> +
> +#ifdef MODULE
> +MODULE_LICENSE("GPL");
> +#endif /* MODULE */

That ifdef/endif should not be necessary.
Did you try a modular build without them?

-- 
~Randy



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux