diff mbox series

drm/todo: Add entry for using kunit in the subsystem

Message ID 20220504080212.713275-1-javierm@redhat.com (mailing list archive)
State Mainlined
Headers show
Series drm/todo: Add entry for using kunit in the subsystem | expand

Commit Message

Javier Martinez Canillas May 4, 2022, 8:02 a.m. UTC
The Kernel Unit Testing (KUnit) framework provides a common framework for
unit tests within the Linux kernel. Having a test suite would allow to
identify regressions earlier.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---

 Documentation/gpu/todo.rst | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Maxime Ripard May 4, 2022, 8:10 a.m. UTC | #1
Hi,

On Wed, May 04, 2022 at 10:02:12AM +0200, Javier Martinez Canillas wrote:
> The Kernel Unit Testing (KUnit) framework provides a common framework for
> unit tests within the Linux kernel. Having a test suite would allow to
> identify regressions earlier.
> 
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> ---
> 
>  Documentation/gpu/todo.rst | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index 127e76ee0b2d..10bfb50908d1 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -603,6 +603,20 @@ Level: Advanced
>  Better Testing
>  ==============
>  
> +Add unit tests using the Kernel Unit Testing (KUnit) framework
> +--------------------------------------------------------------
> +
> +The `KUnit <https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html>`_
> +provides a common framework for unit tests within the Linux kernel. Having a
> +test suite would allow to identify regressions earlier.
> +
> +A good candidate for the first unit tests are the format-conversion helpers in
> +``drm_format_helper.c``.
> +
> +Contact: Javier Martinez Canillas <javierm@redhat.com>
> +
> +Level: Intermediate

Kunit is fairly easy to grasp if you have some knowledge of other unit
testing frameworks already (pytest, cmocka, etc.)

Another good candidate would be to convert (some ?) selftests to kunit.
I'm not sure the others, but at least test-drm_cmdline_parser should be
fairly easy to convert.

Maxime
Javier Martinez Canillas May 4, 2022, 8:34 a.m. UTC | #2
Hello Maxime,

Thanks for your feedback.

On 5/4/22 10:10, Maxime Ripard wrote:
> Hi,
> 
> On Wed, May 04, 2022 at 10:02:12AM +0200, Javier Martinez Canillas wrote:
>> The Kernel Unit Testing (KUnit) framework provides a common framework for
>> unit tests within the Linux kernel. Having a test suite would allow to
>> identify regressions earlier.
>>
>> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
>> ---
>>
>>  Documentation/gpu/todo.rst | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
>> index 127e76ee0b2d..10bfb50908d1 100644
>> --- a/Documentation/gpu/todo.rst
>> +++ b/Documentation/gpu/todo.rst
>> @@ -603,6 +603,20 @@ Level: Advanced
>>  Better Testing
>>  ==============
>>  
>> +Add unit tests using the Kernel Unit Testing (KUnit) framework
>> +--------------------------------------------------------------
>> +
>> +The `KUnit <https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html>`_
>> +provides a common framework for unit tests within the Linux kernel. Having a
>> +test suite would allow to identify regressions earlier.
>> +
>> +A good candidate for the first unit tests are the format-conversion helpers in
>> +``drm_format_helper.c``.
>> +
>> +Contact: Javier Martinez Canillas <javierm@redhat.com>
>> +
>> +Level: Intermediate
> 
> Kunit is fairly easy to grasp if you have some knowledge of other unit
> testing frameworks already (pytest, cmocka, etc.)
>

Yes, I didn't set to intermediate due kunit but rather due the format
conversions, since the functions are not easy to read and understand.

And the person writing the unit tests will have to get familiar with
the different formats to verify that conversions are done correctly.
 
> Another good candidate would be to convert (some ?) selftests to kunit.
> I'm not sure the others, but at least test-drm_cmdline_parser should be
> fairly easy to convert.
>

Indeed. Maybe I would add it as a separate entr though, as a follow-up.
 
> Maxime
Daniel Vetter May 4, 2022, 8:53 a.m. UTC | #3
On Wed, May 04, 2022 at 10:10:30AM +0200, Maxime Ripard wrote:
> Hi,
> 
> On Wed, May 04, 2022 at 10:02:12AM +0200, Javier Martinez Canillas wrote:
> > The Kernel Unit Testing (KUnit) framework provides a common framework for
> > unit tests within the Linux kernel. Having a test suite would allow to
> > identify regressions earlier.
> > 
> > Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> > ---
> > 
> >  Documentation/gpu/todo.rst | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> > 
> > diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> > index 127e76ee0b2d..10bfb50908d1 100644
> > --- a/Documentation/gpu/todo.rst
> > +++ b/Documentation/gpu/todo.rst
> > @@ -603,6 +603,20 @@ Level: Advanced
> >  Better Testing
> >  ==============
> >  
> > +Add unit tests using the Kernel Unit Testing (KUnit) framework
> > +--------------------------------------------------------------
> > +
> > +The `KUnit <https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html>`_
> > +provides a common framework for unit tests within the Linux kernel. Having a
> > +test suite would allow to identify regressions earlier.
> > +
> > +A good candidate for the first unit tests are the format-conversion helpers in
> > +``drm_format_helper.c``.
> > +
> > +Contact: Javier Martinez Canillas <javierm@redhat.com>
> > +
> > +Level: Intermediate
> 
> Kunit is fairly easy to grasp if you have some knowledge of other unit
> testing frameworks already (pytest, cmocka, etc.)
> 
> Another good candidate would be to convert (some ?) selftests to kunit.
> I'm not sure the others, but at least test-drm_cmdline_parser should be
> fairly easy to convert.

All the drm selftest should be good candidates for conversion to kunit.

Either way patch is Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Cheers, Daniel
Maxime Ripard May 4, 2022, 2:16 p.m. UTC | #4
On Wed, May 04, 2022 at 10:34:39AM +0200, Javier Martinez Canillas wrote:
> Hello Maxime,
> 
> Thanks for your feedback.
> 
> On 5/4/22 10:10, Maxime Ripard wrote:
> > Hi,
> > 
> > On Wed, May 04, 2022 at 10:02:12AM +0200, Javier Martinez Canillas wrote:
> >> The Kernel Unit Testing (KUnit) framework provides a common framework for
> >> unit tests within the Linux kernel. Having a test suite would allow to
> >> identify regressions earlier.
> >>
> >> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> >> ---
> >>
> >>  Documentation/gpu/todo.rst | 14 ++++++++++++++
> >>  1 file changed, 14 insertions(+)
> >>
> >> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> >> index 127e76ee0b2d..10bfb50908d1 100644
> >> --- a/Documentation/gpu/todo.rst
> >> +++ b/Documentation/gpu/todo.rst
> >> @@ -603,6 +603,20 @@ Level: Advanced
> >>  Better Testing
> >>  ==============
> >>  
> >> +Add unit tests using the Kernel Unit Testing (KUnit) framework
> >> +--------------------------------------------------------------
> >> +
> >> +The `KUnit <https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html>`_
> >> +provides a common framework for unit tests within the Linux kernel. Having a
> >> +test suite would allow to identify regressions earlier.
> >> +
> >> +A good candidate for the first unit tests are the format-conversion helpers in
> >> +``drm_format_helper.c``.
> >> +
> >> +Contact: Javier Martinez Canillas <javierm@redhat.com>
> >> +
> >> +Level: Intermediate
> > 
> > Kunit is fairly easy to grasp if you have some knowledge of other unit
> > testing frameworks already (pytest, cmocka, etc.)
> >
> 
> Yes, I didn't set to intermediate due kunit but rather due the format
> conversions, since the functions are not easy to read and understand.
> 
> And the person writing the unit tests will have to get familiar with
> the different formats to verify that conversions are done correctly.
>  
> > Another good candidate would be to convert (some ?) selftests to kunit.
> > I'm not sure the others, but at least test-drm_cmdline_parser should be
> > fairly easy to convert.
> >
> 
> Indeed. Maybe I would add it as a separate entr though, as a follow-up.

Yeah, that works for me

Acked-by: Maxime Ripard <maxime@cerno.tech>

Maxime
Thomas Zimmermann May 4, 2022, 2:49 p.m. UTC | #5
Hi

Am 04.05.22 um 10:02 schrieb Javier Martinez Canillas:
> The Kernel Unit Testing (KUnit) framework provides a common framework for
> unit tests within the Linux kernel. Having a test suite would allow to
> identify regressions earlier.
> 
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> ---
> 
>   Documentation/gpu/todo.rst | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
> 
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index 127e76ee0b2d..10bfb50908d1 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -603,6 +603,20 @@ Level: Advanced
>   Better Testing
>   ==============
>   
> +Add unit tests using the Kernel Unit Testing (KUnit) framework
> +--------------------------------------------------------------
> +
> +The `KUnit <https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html>`_
> +provides a common framework for unit tests within the Linux kernel. Having a
> +test suite would allow to identify regressions earlier.
> +
> +A good candidate for the first unit tests are the format-conversion helpers in
> +``drm_format_helper.c``.
> +
> +Contact: Javier Martinez Canillas <javierm@redhat.com>

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>

> +
> +Level: Intermediate
> +
>   Enable trinity for DRM
>   ----------------------
>
Javier Martinez Canillas May 5, 2022, 8:32 a.m. UTC | #6
On 5/4/22 10:02, Javier Martinez Canillas wrote:
> The Kernel Unit Testing (KUnit) framework provides a common framework for
> unit tests within the Linux kernel. Having a test suite would allow to
> identify regressions earlier.
> 
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> ---

Pushed to drm-misc (drm-misc-next). Thanks all!
diff mbox series

Patch

diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 127e76ee0b2d..10bfb50908d1 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -603,6 +603,20 @@  Level: Advanced
 Better Testing
 ==============
 
+Add unit tests using the Kernel Unit Testing (KUnit) framework
+--------------------------------------------------------------
+
+The `KUnit <https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html>`_
+provides a common framework for unit tests within the Linux kernel. Having a
+test suite would allow to identify regressions earlier.
+
+A good candidate for the first unit tests are the format-conversion helpers in
+``drm_format_helper.c``.
+
+Contact: Javier Martinez Canillas <javierm@redhat.com>
+
+Level: Intermediate
+
 Enable trinity for DRM
 ----------------------