diff mbox series

[v2,2/2] unicode: kunit: change tests filename and path

Message ID 20240928235825.96961-3-porlando@lkcamp.dev
State New
Headers show
Series unicode: kunit: refactor selftest to kunit tests | expand

Commit Message

Pedro Orlando Sept. 28, 2024, 11:58 p.m. UTC
From: Gabriela Bittencourt <gbittencourt@lkcamp.dev>

Change utf8 kunit test filename and path to follow the style
convention on Documentation/dev-tools/kunit/style.rst

Co-developed-by: Pedro Orlando <porlando@lkcamp.dev>
Signed-off-by: Pedro Orlando <porlando@lkcamp.dev>
Co-developed-by: Danilo Pereira <dpereira@lkcamp.dev>
Signed-off-by: Danilo Pereira <dpereira@lkcamp.dev>
Signed-off-by: Gabriela Bittencourt <gbittencourt@lkcamp.dev>
---
 fs/unicode/Makefile                                | 2 +-
 fs/unicode/{ => tests}/.kunitconfig                | 0
 fs/unicode/{utf8-selftest.c => tests/utf8_kunit.c} | 0
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename fs/unicode/{ => tests}/.kunitconfig (100%)
 rename fs/unicode/{utf8-selftest.c => tests/utf8_kunit.c} (100%)

Comments

André Almeida Oct. 2, 2024, 1:08 p.m. UTC | #1
Em 28/09/2024 20:58, Pedro Orlando escreveu:
> From: Gabriela Bittencourt <gbittencourt@lkcamp.dev>
> 
> Change utf8 kunit test filename and path to follow the style
> convention on Documentation/dev-tools/kunit/style.rst
> 
> Co-developed-by: Pedro Orlando <porlando@lkcamp.dev>
> Signed-off-by: Pedro Orlando <porlando@lkcamp.dev>
> Co-developed-by: Danilo Pereira <dpereira@lkcamp.dev>
> Signed-off-by: Danilo Pereira <dpereira@lkcamp.dev>
> Signed-off-by: Gabriela Bittencourt <gbittencourt@lkcamp.dev>

I think you missed this in:

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>

 From 
https://lore.kernel.org/all/7e831d5b-1bc4-4d6d-99d7-b160cd580528@linuxfoundation.org/
David Gow Oct. 3, 2024, 6:54 a.m. UTC | #2
On Sun, 29 Sept 2024 at 08:00, Pedro Orlando <porlando@lkcamp.dev> wrote:
>
> From: Gabriela Bittencourt <gbittencourt@lkcamp.dev>
>
> Change utf8 kunit test filename and path to follow the style
> convention on Documentation/dev-tools/kunit/style.rst
>
> Co-developed-by: Pedro Orlando <porlando@lkcamp.dev>
> Signed-off-by: Pedro Orlando <porlando@lkcamp.dev>
> Co-developed-by: Danilo Pereira <dpereira@lkcamp.dev>
> Signed-off-by: Danilo Pereira <dpereira@lkcamp.dev>
> Signed-off-by: Gabriela Bittencourt <gbittencourt@lkcamp.dev>
> ---

This looks good to me. The only thing I'm not 100% sure about is
whether or not we want to move the .kunitconfig file into the tests/
directory. I'm leaning towards "yes", but we may want to update
kunit.py at some point to support automatically adding tests/ to the
search path for a .kunitconfig if this becomes a common enough
pattern.

Regardless, let's take this as-is.

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

Cheers,
-- David


>  fs/unicode/Makefile                                | 2 +-
>  fs/unicode/{ => tests}/.kunitconfig                | 0
>  fs/unicode/{utf8-selftest.c => tests/utf8_kunit.c} | 0
>  3 files changed, 1 insertion(+), 1 deletion(-)
>  rename fs/unicode/{ => tests}/.kunitconfig (100%)
>  rename fs/unicode/{utf8-selftest.c => tests/utf8_kunit.c} (100%)
>
> diff --git a/fs/unicode/Makefile b/fs/unicode/Makefile
> index 37bbcbc628a1..d95be7fb9f6b 100644
> --- a/fs/unicode/Makefile
> +++ b/fs/unicode/Makefile
> @@ -4,7 +4,7 @@ ifneq ($(CONFIG_UNICODE),)
>  obj-y                  += unicode.o
>  endif
>  obj-$(CONFIG_UNICODE)  += utf8data.o
> -obj-$(CONFIG_UNICODE_NORMALIZATION_KUNIT_TEST) += utf8-selftest.o
> +obj-$(CONFIG_UNICODE_NORMALIZATION_KUNIT_TEST) += tests/utf8_kunit.o
>
>  unicode-y := utf8-norm.o utf8-core.o
>
> diff --git a/fs/unicode/.kunitconfig b/fs/unicode/tests/.kunitconfig
> similarity index 100%
> rename from fs/unicode/.kunitconfig
> rename to fs/unicode/tests/.kunitconfig
> diff --git a/fs/unicode/utf8-selftest.c b/fs/unicode/tests/utf8_kunit.c
> similarity index 100%
> rename from fs/unicode/utf8-selftest.c
> rename to fs/unicode/tests/utf8_kunit.c
> --
> 2.34.1
>
Gabriel Krisman Bertazi Oct. 4, 2024, 7 p.m. UTC | #3
Pedro Orlando <porlando@lkcamp.dev> writes:

> From: Gabriela Bittencourt <gbittencourt@lkcamp.dev>
>
> Change utf8 kunit test filename and path to follow the style
> convention on Documentation/dev-tools/kunit/style.rst
>
> Co-developed-by: Pedro Orlando <porlando@lkcamp.dev>
> Signed-off-by: Pedro Orlando <porlando@lkcamp.dev>
> Co-developed-by: Danilo Pereira <dpereira@lkcamp.dev>
> Signed-off-by: Danilo Pereira <dpereira@lkcamp.dev>
> Signed-off-by: Gabriela Bittencourt <gbittencourt@lkcamp.dev>
> ---
>  fs/unicode/Makefile                                | 2 +-
>  fs/unicode/{ => tests}/.kunitconfig                | 0
>  fs/unicode/{utf8-selftest.c => tests/utf8_kunit.c} | 0
>  3 files changed, 1 insertion(+), 1 deletion(-)
>  rename fs/unicode/{ => tests}/.kunitconfig (100%)
>  rename fs/unicode/{utf8-selftest.c => tests/utf8_kunit.c} (100%)
>
> diff --git a/fs/unicode/Makefile b/fs/unicode/Makefile
> index 37bbcbc628a1..d95be7fb9f6b 100644
> --- a/fs/unicode/Makefile
> +++ b/fs/unicode/Makefile
> @@ -4,7 +4,7 @@ ifneq ($(CONFIG_UNICODE),)
>  obj-y			+= unicode.o
>  endif
>  obj-$(CONFIG_UNICODE)	+= utf8data.o
> -obj-$(CONFIG_UNICODE_NORMALIZATION_KUNIT_TEST) += utf8-selftest.o
> +obj-$(CONFIG_UNICODE_NORMALIZATION_KUNIT_TEST) += tests/utf8_kunit.o

This breaks compilation for me.

fs/unicode/tests/utf8_kunit.c:11:10: fatal error: utf8n.h: No such file or directory
   11 | #include "utf8n.h"
      |          ^~~~~~~~~

After this patch that local header is now in the parent directory.

I'm building with:

CONFIG_UNICODE=m
CONFIG_UNICODE_NORMALIZATION_KUNIT_TEST=m

>  unicode-y := utf8-norm.o utf8-core.o
>  
> diff --git a/fs/unicode/.kunitconfig b/fs/unicode/tests/.kunitconfig
> similarity index 100%
> rename from fs/unicode/.kunitconfig
> rename to fs/unicode/tests/.kunitconfig
> diff --git a/fs/unicode/utf8-selftest.c b/fs/unicode/tests/utf8_kunit.c
> similarity index 100%
> rename from fs/unicode/utf8-selftest.c
> rename to fs/unicode/tests/utf8_kunit.c
David Gow Feb. 12, 2025, 9:31 a.m. UTC | #4
On Wed, 12 Feb 2025 at 14:45, Thorsten Leemhuis <linux@leemhuis.info> wrote:
>
> On 04.10.24 21:00, Gabriel Krisman Bertazi wrote:
> > Pedro Orlando <porlando@lkcamp.dev> writes:
> >> From: Gabriela Bittencourt <gbittencourt@lkcamp.dev>
> >>
> >> Change utf8 kunit test filename and path to follow the style
> >> convention on Documentation/dev-tools/kunit/style.rst
> >>
> >> Co-developed-by: Pedro Orlando <porlando@lkcamp.dev>
> >> Signed-off-by: Pedro Orlando <porlando@lkcamp.dev>
> >> Co-developed-by: Danilo Pereira <dpereira@lkcamp.dev>
> >> Signed-off-by: Danilo Pereira <dpereira@lkcamp.dev>
> >> Signed-off-by: Gabriela Bittencourt <gbittencourt@lkcamp.dev>
> >> ---
> >>  fs/unicode/Makefile                                | 2 +-
> >>  fs/unicode/{ => tests}/.kunitconfig                | 0
> >>  fs/unicode/{utf8-selftest.c => tests/utf8_kunit.c} | 0
> >>  3 files changed, 1 insertion(+), 1 deletion(-)
> >>  rename fs/unicode/{ => tests}/.kunitconfig (100%)
> >>  rename fs/unicode/{utf8-selftest.c => tests/utf8_kunit.c} (100%)
> >>
> >> diff --git a/fs/unicode/Makefile b/fs/unicode/Makefile
> >> index 37bbcbc628a1..d95be7fb9f6b 100644
> >> --- a/fs/unicode/Makefile
> >> +++ b/fs/unicode/Makefile
> >> @@ -4,7 +4,7 @@ ifneq ($(CONFIG_UNICODE),)
> >>  obj-y                       += unicode.o
> >>  endif
> >>  obj-$(CONFIG_UNICODE)       += utf8data.o
> >> -obj-$(CONFIG_UNICODE_NORMALIZATION_KUNIT_TEST) += utf8-selftest.o
> >> +obj-$(CONFIG_UNICODE_NORMALIZATION_KUNIT_TEST) += tests/utf8_kunit.o
> >
> > This breaks compilation for me.
> >
> > fs/unicode/tests/utf8_kunit.c:11:10: fatal error: utf8n.h: No such file or directory
> >    11 | #include "utf8n.h"
> >       |          ^~~~~~~~~
>
> I encountered the same error when building -next using the Fedora
> rawhide config today. Given that this patch landed in -next today I
> suspect it might be due to this change, but I'm on the road and unable
> to verify that right now.
>
> Log:
> https://download.copr.fedorainfracloud.org/results/@kernel-vanilla/next/fedora-rawhide-x86_64/08642966-next-next-all/builder-live.log.gz
>
> Cioa, Thorsten
>

Hmm... this definitely seems like a problem, but I haven't been able
to reproduce it here (either under x86_64 or UML, both as a module and
built-in). The suggested fix of changing the path to "../utf8n.h"
doesn't seem to have broken it, though.

Cheers,
-- David
diff mbox series

Patch

diff --git a/fs/unicode/Makefile b/fs/unicode/Makefile
index 37bbcbc628a1..d95be7fb9f6b 100644
--- a/fs/unicode/Makefile
+++ b/fs/unicode/Makefile
@@ -4,7 +4,7 @@  ifneq ($(CONFIG_UNICODE),)
 obj-y			+= unicode.o
 endif
 obj-$(CONFIG_UNICODE)	+= utf8data.o
-obj-$(CONFIG_UNICODE_NORMALIZATION_KUNIT_TEST) += utf8-selftest.o
+obj-$(CONFIG_UNICODE_NORMALIZATION_KUNIT_TEST) += tests/utf8_kunit.o
 
 unicode-y := utf8-norm.o utf8-core.o
 
diff --git a/fs/unicode/.kunitconfig b/fs/unicode/tests/.kunitconfig
similarity index 100%
rename from fs/unicode/.kunitconfig
rename to fs/unicode/tests/.kunitconfig
diff --git a/fs/unicode/utf8-selftest.c b/fs/unicode/tests/utf8_kunit.c
similarity index 100%
rename from fs/unicode/utf8-selftest.c
rename to fs/unicode/tests/utf8_kunit.c