Linux-kselftest Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] Documentation: kunit: Update Kconfig parts for KUNIT's module support
@ 2020-10-13  6:37 SeongJae Park
  2020-10-20  6:54 ` SeongJae Park
  2020-10-21  4:06 ` David Gow
  0 siblings, 2 replies; 4+ messages in thread
From: SeongJae Park @ 2020-10-13  6:37 UTC (permalink / raw)
  To: brendanhiggins
  Cc: SeongJae Park, corbet, skhan, linux-kselftest, kunit-dev,
	linux-doc, linux-kernel

From: SeongJae Park <sjpark@amazon.de>

If 'CONFIG_KUNIT=m', letting kunit tests that do not support loadable
module build depends on 'KUNIT' instead of 'KUNIT=y' result in compile
errors.  This commit updates the document for this.

Fixes: 9fe124bf1b77 ("kunit: allow kunit to be loaded as a module")
Signed-off-by: SeongJae Park <sjpark@amazon.de>
---

Changes from v1
(https://lore.kernel.org/linux-kselftest/20201012105420.5945-1-sjpark@amazon.com/):
- Fix a typo (Marco Elver)

---
 Documentation/dev-tools/kunit/start.rst | 2 +-
 Documentation/dev-tools/kunit/usage.rst | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst
index d23385e3e159..454f307813ea 100644
--- a/Documentation/dev-tools/kunit/start.rst
+++ b/Documentation/dev-tools/kunit/start.rst
@@ -197,7 +197,7 @@ Now add the following to ``drivers/misc/Kconfig``:
 
 	config MISC_EXAMPLE_TEST
 		bool "Test for my example"
-		depends on MISC_EXAMPLE && KUNIT
+		depends on MISC_EXAMPLE && KUNIT=y
 
 and the following to ``drivers/misc/Makefile``:
 
diff --git a/Documentation/dev-tools/kunit/usage.rst b/Documentation/dev-tools/kunit/usage.rst
index 3c3fe8b5fecc..b331f5a5b0b9 100644
--- a/Documentation/dev-tools/kunit/usage.rst
+++ b/Documentation/dev-tools/kunit/usage.rst
@@ -556,6 +556,11 @@ Once the kernel is built and installed, a simple
 
 ...will run the tests.
 
+.. note::
+   Note that you should make your test depends on ``KUNIT=y`` in Kconfig if the
+   test does not support module build.  Otherwise, it will trigger compile
+   errors if ``CONFIG_KUNIT`` is ``m``.
+
 Writing new tests for other architectures
 -----------------------------------------
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] Documentation: kunit: Update Kconfig parts for KUNIT's module support
  2020-10-13  6:37 [PATCH v2] Documentation: kunit: Update Kconfig parts for KUNIT's module support SeongJae Park
@ 2020-10-20  6:54 ` SeongJae Park
  2020-10-21  4:06 ` David Gow
  1 sibling, 0 replies; 4+ messages in thread
From: SeongJae Park @ 2020-10-20  6:54 UTC (permalink / raw)
  To: SeongJae Park
  Cc: brendanhiggins, SeongJae Park, corbet, skhan, linux-kselftest,
	kunit-dev, linux-doc, linux-kernel, elver

I just realized I missed adding Marco Elver as a recipient, so adding him.
Sorry, Marco.


Thanks,
SeongJae Park

On Tue, 13 Oct 2020 08:37:43 +0200 SeongJae Park <sjpark@amazon.com> wrote:

> From: SeongJae Park <sjpark@amazon.de>
> 
> If 'CONFIG_KUNIT=m', letting kunit tests that do not support loadable
> module build depends on 'KUNIT' instead of 'KUNIT=y' result in compile
> errors.  This commit updates the document for this.
> 
> Fixes: 9fe124bf1b77 ("kunit: allow kunit to be loaded as a module")
> Signed-off-by: SeongJae Park <sjpark@amazon.de>
> ---
> 
> Changes from v1
> (https://lore.kernel.org/linux-kselftest/20201012105420.5945-1-sjpark@amazon.com/):
> - Fix a typo (Marco Elver)
> 
> ---
>  Documentation/dev-tools/kunit/start.rst | 2 +-
>  Documentation/dev-tools/kunit/usage.rst | 5 +++++
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst
> index d23385e3e159..454f307813ea 100644
> --- a/Documentation/dev-tools/kunit/start.rst
> +++ b/Documentation/dev-tools/kunit/start.rst
> @@ -197,7 +197,7 @@ Now add the following to ``drivers/misc/Kconfig``:
>  
>  	config MISC_EXAMPLE_TEST
>  		bool "Test for my example"
> -		depends on MISC_EXAMPLE && KUNIT
> +		depends on MISC_EXAMPLE && KUNIT=y
>  
>  and the following to ``drivers/misc/Makefile``:
>  
> diff --git a/Documentation/dev-tools/kunit/usage.rst b/Documentation/dev-tools/kunit/usage.rst
> index 3c3fe8b5fecc..b331f5a5b0b9 100644
> --- a/Documentation/dev-tools/kunit/usage.rst
> +++ b/Documentation/dev-tools/kunit/usage.rst
> @@ -556,6 +556,11 @@ Once the kernel is built and installed, a simple
>  
>  ...will run the tests.
>  
> +.. note::
> +   Note that you should make your test depends on ``KUNIT=y`` in Kconfig if the
> +   test does not support module build.  Otherwise, it will trigger compile
> +   errors if ``CONFIG_KUNIT`` is ``m``.
> +
>  Writing new tests for other architectures
>  -----------------------------------------
>  
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] Documentation: kunit: Update Kconfig parts for KUNIT's module support
  2020-10-13  6:37 [PATCH v2] Documentation: kunit: Update Kconfig parts for KUNIT's module support SeongJae Park
  2020-10-20  6:54 ` SeongJae Park
@ 2020-10-21  4:06 ` David Gow
  2020-10-21 19:17   ` SeongJae Park
  1 sibling, 1 reply; 4+ messages in thread
From: David Gow @ 2020-10-21  4:06 UTC (permalink / raw)
  To: SeongJae Park
  Cc: Brendan Higgins, SeongJae Park, Jonathan Corbet, Shuah Khan,
	open list:KERNEL SELFTEST FRAMEWORK, KUnit Development,
	open list:DOCUMENTATION, Linux Kernel Mailing List

On Tue, Oct 13, 2020 at 2:38 PM 'SeongJae Park' via KUnit Development
<kunit-dev@googlegroups.com> wrote:
>
> From: SeongJae Park <sjpark@amazon.de>
>
> If 'CONFIG_KUNIT=m', letting kunit tests that do not support loadable
> module build depends on 'KUNIT' instead of 'KUNIT=y' result in compile
> errors.  This commit updates the document for this.
>
> Fixes: 9fe124bf1b77 ("kunit: allow kunit to be loaded as a module")
> Signed-off-by: SeongJae Park <sjpark@amazon.de>

Sorry for the delay in looking at this. Apart from another minuscule
typo below, this looks good to me.

Reviewed-by: David Gow <davidgow@google.com>

Cheers,
-- David

> ---
>
> Changes from v1
> (https://lore.kernel.org/linux-kselftest/20201012105420.5945-1-sjpark@amazon.com/):
> - Fix a typo (Marco Elver)
>
> ---
>  Documentation/dev-tools/kunit/start.rst | 2 +-
>  Documentation/dev-tools/kunit/usage.rst | 5 +++++
>  2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst
> index d23385e3e159..454f307813ea 100644
> --- a/Documentation/dev-tools/kunit/start.rst
> +++ b/Documentation/dev-tools/kunit/start.rst
> @@ -197,7 +197,7 @@ Now add the following to ``drivers/misc/Kconfig``:
>
>         config MISC_EXAMPLE_TEST
>                 bool "Test for my example"
> -               depends on MISC_EXAMPLE && KUNIT
> +               depends on MISC_EXAMPLE && KUNIT=y
>
>  and the following to ``drivers/misc/Makefile``:
>
> diff --git a/Documentation/dev-tools/kunit/usage.rst b/Documentation/dev-tools/kunit/usage.rst
> index 3c3fe8b5fecc..b331f5a5b0b9 100644
> --- a/Documentation/dev-tools/kunit/usage.rst
> +++ b/Documentation/dev-tools/kunit/usage.rst
> @@ -556,6 +556,11 @@ Once the kernel is built and installed, a simple
>
>  ...will run the tests.
>
> +.. note::
> +   Note that you should make your test depends on ``KUNIT=y`` in Kconfig if the
nit: Grammatically, this should technically be either "depend" (2nd
person), or something like "make sure [that] your test depends".

> +   test does not support module build.  Otherwise, it will trigger compile
> +   errors if ``CONFIG_KUNIT`` is ``m``.
> +

Someday it'd be nice to better discuss the reasons a test suite might
not be compilable as a module. It's probably outside the scope of this
commit to do it properly, though.

>  Writing new tests for other architectures
>  -----------------------------------------
>
> --
> 2.17.1
>
> --
> You received this message because you are subscribed to the Google Groups "KUnit Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kunit-dev+unsubscribe@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/kunit-dev/20201013063743.32179-1-sjpark%40amazon.com.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] Documentation: kunit: Update Kconfig parts for KUNIT's module support
  2020-10-21  4:06 ` David Gow
@ 2020-10-21 19:17   ` SeongJae Park
  0 siblings, 0 replies; 4+ messages in thread
From: SeongJae Park @ 2020-10-21 19:17 UTC (permalink / raw)
  To: David Gow
  Cc: SeongJae Park, Brendan Higgins, SeongJae Park, Jonathan Corbet,
	Shuah Khan, open list:KERNEL SELFTEST FRAMEWORK,
	KUnit Development, open list:DOCUMENTATION,
	Linux Kernel Mailing List

On Wed, 21 Oct 2020 12:06:13 +0800 David Gow <davidgow@google.com> wrote:

> On Tue, Oct 13, 2020 at 2:38 PM 'SeongJae Park' via KUnit Development
> <kunit-dev@googlegroups.com> wrote:
> >
> > From: SeongJae Park <sjpark@amazon.de>
> >
> > If 'CONFIG_KUNIT=m', letting kunit tests that do not support loadable
> > module build depends on 'KUNIT' instead of 'KUNIT=y' result in compile
> > errors.  This commit updates the document for this.
> >
> > Fixes: 9fe124bf1b77 ("kunit: allow kunit to be loaded as a module")
> > Signed-off-by: SeongJae Park <sjpark@amazon.de>
> 
> Sorry for the delay in looking at this. Apart from another minuscule
> typo below, this looks good to me.
> 
> Reviewed-by: David Gow <davidgow@google.com>

Thanks!

> 
> Cheers,
> -- David
> 
> > ---
> >
> > Changes from v1
> > (https://lore.kernel.org/linux-kselftest/20201012105420.5945-1-sjpark@amazon.com/):
> > - Fix a typo (Marco Elver)
> >
> > ---
> >  Documentation/dev-tools/kunit/start.rst | 2 +-
> >  Documentation/dev-tools/kunit/usage.rst | 5 +++++
> >  2 files changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/dev-tools/kunit/start.rst b/Documentation/dev-tools/kunit/start.rst
> > index d23385e3e159..454f307813ea 100644
> > --- a/Documentation/dev-tools/kunit/start.rst
> > +++ b/Documentation/dev-tools/kunit/start.rst
> > @@ -197,7 +197,7 @@ Now add the following to ``drivers/misc/Kconfig``:
> >
> >         config MISC_EXAMPLE_TEST
> >                 bool "Test for my example"
> > -               depends on MISC_EXAMPLE && KUNIT
> > +               depends on MISC_EXAMPLE && KUNIT=y
> >
> >  and the following to ``drivers/misc/Makefile``:
> >
> > diff --git a/Documentation/dev-tools/kunit/usage.rst b/Documentation/dev-tools/kunit/usage.rst
> > index 3c3fe8b5fecc..b331f5a5b0b9 100644
> > --- a/Documentation/dev-tools/kunit/usage.rst
> > +++ b/Documentation/dev-tools/kunit/usage.rst
> > @@ -556,6 +556,11 @@ Once the kernel is built and installed, a simple
> >
> >  ...will run the tests.
> >
> > +.. note::
> > +   Note that you should make your test depends on ``KUNIT=y`` in Kconfig if the
> nit: Grammatically, this should technically be either "depend" (2nd
> person), or something like "make sure [that] your test depends".

Good eye!  I will fix this in the next version.


Thanks,
SeongJae Park

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-13  6:37 [PATCH v2] Documentation: kunit: Update Kconfig parts for KUNIT's module support SeongJae Park
2020-10-20  6:54 ` SeongJae Park
2020-10-21  4:06 ` David Gow
2020-10-21 19:17   ` SeongJae Park

Linux-kselftest Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-kselftest/0 linux-kselftest/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-kselftest linux-kselftest/ https://lore.kernel.org/linux-kselftest \
		linux-kselftest@vger.kernel.org
	public-inbox-index linux-kselftest

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kselftest


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git