From patchwork Sun Sep 22 20:16:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriela Bittencourt X-Patchwork-Id: 13809188 Received: from sendmail.purelymail.com (sendmail.purelymail.com [34.202.193.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C7B3B64A for ; Sun, 22 Sep 2024 20:12:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=34.202.193.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727035975; cv=none; b=lKnWH86HZjpAqPNaTa+QR2LUpGkoraI3sp3iXPbkplL9x+7I6UxM5sgpddKQ1mLmbE74lop7hvER5y4EpQ3Psr/LCHCm/jU7oV5ySGgRdNOqLWqDp7qY+KYIjfblOary4TldKgmw7+Cr/xFQ3zR1DPABZz2KwG4+4H45fEpoo8w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727035975; c=relaxed/simple; bh=inCtHAmTJCP6fyLTthP9KSWimhLxZHn1OlOWVhQLTLg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=USulfP+Y27tGNLd7HhxXZNNbfNdxz054iHiG62quUJFa0OfdCOCCiTadveaJ1VWg9fqSY4AkMeThSRcGrHgwUlnGLsHWG924yYXD8XQvETFFYigR5i4M9rq5Y4BwGx8DI/9aR8weP9ZQYyP9vNHrBPvuxOtKFeESvCKETE82prM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=lkcamp.dev; spf=pass smtp.mailfrom=lkcamp.dev; dkim=pass (2048-bit key) header.d=lkcamp.dev header.i=@lkcamp.dev header.b=hUiIYKBo; dkim=pass (2048-bit key) header.d=purelymail.com header.i=@purelymail.com header.b=UQfq6aa4; arc=none smtp.client-ip=34.202.193.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=lkcamp.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lkcamp.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lkcamp.dev header.i=@lkcamp.dev header.b="hUiIYKBo"; dkim=pass (2048-bit key) header.d=purelymail.com header.i=@purelymail.com header.b="UQfq6aa4" Authentication-Results: purelymail.com; auth=pass DKIM-Signature: a=rsa-sha256; b=hUiIYKBoe4wsXvzuGQcMM6AW7s5AsJ4xtGx/lGMpPIKjpTfV9QSQC1eKUplF/S2cF0bDePHgPt8tPPFR4Q2loFzbMDaKEMx2+kw2o+UImiU8Le4aQPyhklEKcGufoR8oUU/5/tButKbWilTwzJXCVI81OD4hVbQLyKx5t7zoKs1BZYhTr+BREF/3zK8aIXyHsebZTRETYcX1A0vxNn45XRw6m+buFn0DipjcV0cvH+BD7TkFd8Vx/eHnjzX1xJ+PDI6KB/a5oA/nYbthPyZU+cEB7U4rwWoVHLXhmTD7I+mtNEPPi6GD12LI7eg/tM4Mi8psxMR8kXvjlw/L54VwRw==; s=purelymail3; d=lkcamp.dev; v=1; bh=inCtHAmTJCP6fyLTthP9KSWimhLxZHn1OlOWVhQLTLg=; h=Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=UQfq6aa4gks4FGmj4L+AwRyZFZjmYEze85rEPKBS2z2SAQzd97/Rp2KQP85vM0ua/reOnn56WPhBWgm41ZYw4csqapNk7c/O/WnrBqWBX22OxoQhXJKeXbDHl45TMZSmjxVjVbq/NfBKIN28d4qfB9mdTHxhyuBc3v3hxaB54VuWWMmFO3gTl+AMaWWC7Kzjy04lIYsu6SnJGnvrQ2jDhyUEeiLGsqUdsFjwRXT9YRb+HGEmgGHe09MRfX8Anf0ON4cmbQuom0lgsF4LvKw/zY6tzkb1Qbxr06InS8zniDNaOSIXD/jczn1MdkbR641ECyCj0TZUGyDYg7fKkfdh7w==; s=purelymail3; d=purelymail.com; v=1; bh=inCtHAmTJCP6fyLTthP9KSWimhLxZHn1OlOWVhQLTLg=; h=Feedback-ID:Received:From:To:Subject:Date; Feedback-ID: 40598:7130:null:purelymail X-Pm-Original-To: linux-fsdevel@vger.kernel.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 1095037770; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 22 Sep 2024 20:12:41 +0000 (UTC) From: Gabriela Bittencourt To: Gabriel Krisman Bertazi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, ~lkcamp/patches@lists.sr.ht Cc: porlando@lkcamp.dev, dpereira@lkcamp.dev Subject: [PATCH 1/2] unicode: kunit: refactor selftest to kunit tests Date: Sun, 22 Sep 2024 17:16:30 -0300 Message-ID: <20240922201631.179925-2-gbittencourt@lkcamp.dev> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240922201631.179925-1-gbittencourt@lkcamp.dev> References: <20240922201631.179925-1-gbittencourt@lkcamp.dev> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail Instead of creating 'test' functions, use kunit functions to test utf-8 support in unicode subsystem. Co-developed-by: Pedro Orlando Signed-off-by: Pedro Orlando Co-developed-by: Danilo Pereira Signed-off-by: Danilo Pereira Signed-off-by: Gabriela Bittencourt --- fs/unicode/.kunitconfig | 3 + fs/unicode/Kconfig | 5 +- fs/unicode/Makefile | 2 +- fs/unicode/utf8-selftest.c | 152 +++++++++++++++++-------------------- 4 files changed, 76 insertions(+), 86 deletions(-) create mode 100644 fs/unicode/.kunitconfig diff --git a/fs/unicode/.kunitconfig b/fs/unicode/.kunitconfig new file mode 100644 index 000000000000..62dd5c171f9c --- /dev/null +++ b/fs/unicode/.kunitconfig @@ -0,0 +1,3 @@ +CONFIG_KUNIT=y +CONFIG_UNICODE=y +CONFIG_UNICODE_NORMALIZATION_KUNIT_TEST=y diff --git a/fs/unicode/Kconfig b/fs/unicode/Kconfig index da786a687fdc..4ad2c36550f1 100644 --- a/fs/unicode/Kconfig +++ b/fs/unicode/Kconfig @@ -10,6 +10,7 @@ config UNICODE be a separate loadable module that gets requested only when a file system actually use it. -config UNICODE_NORMALIZATION_SELFTEST +config UNICODE_NORMALIZATION_KUNIT_TEST tristate "Test UTF-8 normalization support" - depends on UNICODE + depends on UNICODE && KUNIT + default KUNIT_ALL_TESTS diff --git a/fs/unicode/Makefile b/fs/unicode/Makefile index e309afe2b2bb..37bbcbc628a1 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_SELFTEST) += utf8-selftest.o +obj-$(CONFIG_UNICODE_NORMALIZATION_KUNIT_TEST) += utf8-selftest.o unicode-y := utf8-norm.o utf8-core.o diff --git a/fs/unicode/utf8-selftest.c b/fs/unicode/utf8-selftest.c index 600e15efe9ed..54ded8db6b1c 100644 --- a/fs/unicode/utf8-selftest.c +++ b/fs/unicode/utf8-selftest.c @@ -1,38 +1,18 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Kernel module for testing utf-8 support. + * KUnit tests for utf-8 support * * Copyright 2017 Collabora Ltd. */ -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -#include -#include #include -#include +#include #include "utf8n.h" -static unsigned int failed_tests; -static unsigned int total_tests; - /* Tests will be based on this version. */ #define UTF8_LATEST UNICODE_AGE(12, 1, 0) -#define _test(cond, func, line, fmt, ...) do { \ - total_tests++; \ - if (!cond) { \ - failed_tests++; \ - pr_err("test %s:%d Failed: %s%s", \ - func, line, #cond, (fmt?":":".")); \ - if (fmt) \ - pr_err(fmt, ##__VA_ARGS__); \ - } \ - } while (0) -#define test_f(cond, fmt, ...) _test(cond, __func__, __LINE__, fmt, ##__VA_ARGS__) -#define test(cond) _test(cond, __func__, __LINE__, "") - static const struct { /* UTF-8 strings in this vector _must_ be NULL-terminated. */ unsigned char str[10]; @@ -158,22 +138,22 @@ static const struct { } }; -static ssize_t utf8len(const struct unicode_map *um, enum utf8_normalization n, - const char *s) +static ssize_t utf8len(const struct unicode_map *um, enum utf8_normalization n, const char *s) { return utf8nlen(um, n, s, (size_t)-1); } static int utf8cursor(struct utf8cursor *u8c, const struct unicode_map *um, - enum utf8_normalization n, const char *s) + enum utf8_normalization n, const char *s) { return utf8ncursor(u8c, um, n, s, (unsigned int)-1); } -static void check_utf8_nfdi(struct unicode_map *um) +static void check_utf8_nfdi(struct kunit *test) { int i; struct utf8cursor u8c; + struct unicode_map *um = test->priv; for (i = 0; i < ARRAY_SIZE(nfdi_test_data); i++) { int len = strlen(nfdi_test_data[i].str); @@ -181,28 +161,29 @@ static void check_utf8_nfdi(struct unicode_map *um) int j = 0; unsigned char c; - test((utf8len(um, UTF8_NFDI, nfdi_test_data[i].str) == nlen)); - test((utf8nlen(um, UTF8_NFDI, nfdi_test_data[i].str, len) == - nlen)); + KUNIT_EXPECT_EQ(test, utf8len(um, UTF8_NFDI, nfdi_test_data[i].str), nlen); + KUNIT_EXPECT_EQ(test, utf8nlen(um, UTF8_NFDI, nfdi_test_data[i].str, len), + nlen); - if (utf8cursor(&u8c, um, UTF8_NFDI, nfdi_test_data[i].str) < 0) - pr_err("can't create cursor\n"); + KUNIT_EXPECT_GE_MSG(test, utf8cursor(&u8c, um, UTF8_NFDI, nfdi_test_data[i].str), + 0, "Can't create cursor\n"); while ((c = utf8byte(&u8c)) > 0) { - test_f((c == nfdi_test_data[i].dec[j]), - "Unexpected byte 0x%x should be 0x%x\n", - c, nfdi_test_data[i].dec[j]); + KUNIT_EXPECT_EQ_MSG(test, c, nfdi_test_data[i].dec[j], + "Unexpected byte 0x%x should be 0x%x\n", + c, nfdi_test_data[i].dec[j]); j++; } - test((j == nlen)); + KUNIT_EXPECT_EQ(test, j, nlen); } } -static void check_utf8_nfdicf(struct unicode_map *um) +static void check_utf8_nfdicf(struct kunit *test) { int i; struct utf8cursor u8c; + struct unicode_map *um = test->priv; for (i = 0; i < ARRAY_SIZE(nfdicf_test_data); i++) { int len = strlen(nfdicf_test_data[i].str); @@ -210,29 +191,30 @@ static void check_utf8_nfdicf(struct unicode_map *um) int j = 0; unsigned char c; - test((utf8len(um, UTF8_NFDICF, nfdicf_test_data[i].str) == - nlen)); - test((utf8nlen(um, UTF8_NFDICF, nfdicf_test_data[i].str, len) == - nlen)); + KUNIT_EXPECT_EQ(test, utf8len(um, UTF8_NFDICF, nfdicf_test_data[i].str), + nlen); + KUNIT_EXPECT_EQ(test, utf8nlen(um, UTF8_NFDICF, nfdicf_test_data[i].str, len), + nlen); - if (utf8cursor(&u8c, um, UTF8_NFDICF, - nfdicf_test_data[i].str) < 0) - pr_err("can't create cursor\n"); + KUNIT_EXPECT_GE_MSG(test, + utf8cursor(&u8c, um, UTF8_NFDICF, nfdicf_test_data[i].str), + 0, "Can't create cursor\n"); while ((c = utf8byte(&u8c)) > 0) { - test_f((c == nfdicf_test_data[i].ncf[j]), - "Unexpected byte 0x%x should be 0x%x\n", - c, nfdicf_test_data[i].ncf[j]); + KUNIT_EXPECT_EQ_MSG(test, c, nfdicf_test_data[i].ncf[j], + "Unexpected byte 0x%x should be 0x%x\n", + c, nfdicf_test_data[i].ncf[j]); j++; } - test((j == nlen)); + KUNIT_EXPECT_EQ(test, j, nlen); } } -static void check_utf8_comparisons(struct unicode_map *table) +static void check_utf8_comparisons(struct kunit *test) { int i; + struct unicode_map *um = test->priv; for (i = 0; i < ARRAY_SIZE(nfdi_test_data); i++) { const struct qstr s1 = {.name = nfdi_test_data[i].str, @@ -240,8 +222,9 @@ static void check_utf8_comparisons(struct unicode_map *table) const struct qstr s2 = {.name = nfdi_test_data[i].dec, .len = sizeof(nfdi_test_data[i].dec)}; - test_f(!utf8_strncmp(table, &s1, &s2), - "%s %s comparison mismatch\n", s1.name, s2.name); + // strncmp returns 0 when strings are equal + KUNIT_EXPECT_EQ_MSG(test, utf8_strncmp(um, &s1, &s2), 0, + "%s %s comparison mismatch\n", s1.name, s2.name); } for (i = 0; i < ARRAY_SIZE(nfdicf_test_data); i++) { @@ -250,62 +233,65 @@ static void check_utf8_comparisons(struct unicode_map *table) const struct qstr s2 = {.name = nfdicf_test_data[i].ncf, .len = sizeof(nfdicf_test_data[i].ncf)}; - test_f(!utf8_strncasecmp(table, &s1, &s2), - "%s %s comparison mismatch\n", s1.name, s2.name); + // strncasecmp returns 0 when strings are equal + KUNIT_EXPECT_EQ_MSG(test, utf8_strncasecmp(um, &s1, &s2), 0, + "%s %s comparison mismatch\n", s1.name, s2.name); } } -static void check_supported_versions(struct unicode_map *um) +static void check_supported_versions(struct kunit *test) { + struct unicode_map *um = test->priv; /* Unicode 7.0.0 should be supported. */ - test(utf8version_is_supported(um, UNICODE_AGE(7, 0, 0))); + KUNIT_EXPECT_TRUE(test, utf8version_is_supported(um, UNICODE_AGE(7, 0, 0))); /* Unicode 9.0.0 should be supported. */ - test(utf8version_is_supported(um, UNICODE_AGE(9, 0, 0))); + KUNIT_EXPECT_TRUE(test, utf8version_is_supported(um, UNICODE_AGE(9, 0, 0))); /* Unicode 1x.0.0 (the latest version) should be supported. */ - test(utf8version_is_supported(um, UTF8_LATEST)); + KUNIT_EXPECT_TRUE(test, utf8version_is_supported(um, UTF8_LATEST)); /* Next versions don't exist. */ - test(!utf8version_is_supported(um, UNICODE_AGE(13, 0, 0))); - test(!utf8version_is_supported(um, UNICODE_AGE(0, 0, 0))); - test(!utf8version_is_supported(um, UNICODE_AGE(-1, -1, -1))); + KUNIT_EXPECT_FALSE(test, utf8version_is_supported(um, UNICODE_AGE(13, 0, 0))); + KUNIT_EXPECT_FALSE(test, utf8version_is_supported(um, UNICODE_AGE(0, 0, 0))); + KUNIT_EXPECT_FALSE(test, utf8version_is_supported(um, UNICODE_AGE(-1, -1, -1))); } -static int __init init_test_ucd(void) +static struct kunit_case unicode_normalization_test_cases[] = { + KUNIT_CASE(check_supported_versions), + KUNIT_CASE(check_utf8_comparisons), + KUNIT_CASE(check_utf8_nfdicf), + KUNIT_CASE(check_utf8_nfdi), + {} +}; + +static int init_test_ucd(struct kunit *test) { - struct unicode_map *um; + struct unicode_map *um = utf8_load(UTF8_LATEST); - failed_tests = 0; - total_tests = 0; + test->priv = um; - um = utf8_load(UTF8_LATEST); - if (IS_ERR(um)) { - pr_err("%s: Unable to load utf8 table.\n", __func__); - return PTR_ERR(um); - } + KUNIT_EXPECT_EQ_MSG(test, IS_ERR(um), 0, + "%s: Unable to load utf8 table.\n", __func__); - check_supported_versions(um); - check_utf8_nfdi(um); - check_utf8_nfdicf(um); - check_utf8_comparisons(um); - - if (!failed_tests) - pr_info("All %u tests passed\n", total_tests); - else - pr_err("%u out of %u tests failed\n", failed_tests, - total_tests); - utf8_unload(um); return 0; } -static void __exit exit_test_ucd(void) +static void exit_test_ucd(struct kunit *test) { + utf8_unload(test->priv); } -module_init(init_test_ucd); -module_exit(exit_test_ucd); +static struct kunit_suite unicode_normalization_test_suite = { + .name = "unicode_normalization", + .test_cases = unicode_normalization_test_cases, + .init = init_test_ucd, + .exit = exit_test_ucd, +}; + +kunit_test_suite(unicode_normalization_test_suite); + MODULE_AUTHOR("Gabriel Krisman Bertazi "); -MODULE_DESCRIPTION("Kernel module for testing utf-8 support"); +MODULE_DESCRIPTION("KUnit tests for utf-8 support"); MODULE_LICENSE("GPL"); From patchwork Sun Sep 22 20:16:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriela Bittencourt X-Patchwork-Id: 13809187 Received: from sendmail.purelymail.com (sendmail.purelymail.com [34.202.193.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A22A152F62 for ; Sun, 22 Sep 2024 20:12:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=34.202.193.197 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727035974; cv=none; b=twCuwaku5u2uyz1SHoOn4TPnhgqCe1ntP4xqnZ8eWyUVZkVT0aVyC0GS1f/9neKXf383YV04n0s8F7R6Ka9pj4apVtdPE6H2RIGKdEBowZyNu/NDCiBNkrS7F7JvrJr49wY6Lroel+1mmvkVBQfVfeMmIioJTSimpH4oAPiYZgw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727035974; c=relaxed/simple; bh=2nL+gJE/xUGOiECsRdkY2s0zPbV1/VkEl3IslBMeitQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jBDnuG8sFNSaGfBLMu4vHIeKFg8qnDZlwM9d5Hm7F6lfxUyN2svsOLKhfiV+PeF48g/FxPDyK11soWaVP//2ujfuTen/XRY0Pmbtx+uT0vWYqOvsg+0bD/eNqOgAuuHP7R7Nbyfzaq6J12MFts7VMyT+F2RGmIkCNYif6pC62sM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=lkcamp.dev; spf=pass smtp.mailfrom=lkcamp.dev; dkim=pass (2048-bit key) header.d=lkcamp.dev header.i=@lkcamp.dev header.b=qzG8Zztk; dkim=pass (2048-bit key) header.d=purelymail.com header.i=@purelymail.com header.b=H1JgRu0i; arc=none smtp.client-ip=34.202.193.197 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=lkcamp.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lkcamp.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lkcamp.dev header.i=@lkcamp.dev header.b="qzG8Zztk"; dkim=pass (2048-bit key) header.d=purelymail.com header.i=@purelymail.com header.b="H1JgRu0i" Authentication-Results: purelymail.com; auth=pass DKIM-Signature: a=rsa-sha256; b=qzG8Zztkh5s1Lo9kFLi7yd2tIHiUtOP8OPV7KOFTq9jC/OmlZZET4a0WCVAkGTlei2DMVK6mO8caOENY6vLLjx60xtHVGBzdLXIGU23FvWM4AWPDz8sNfvjAfZ7Sy0ZLXdpXedvZLZxlV0k2Q18CwAV9h07C7FVCLRaUTcIwvQqgLRiT7vh6+7QOZ8ADuCrtYq2CmZVdk6MWKikBhrCC5s391+orQ//X4HpzdXjqZUHMMMNO//yXwI7cX7lTVl5L4rx9TyGecoH6yW/ISJ+fF6ggXgLstckrOqS7ZDiPwq0cU3IbEN++yqZeLNZ4Dv3COSn/iem6+o7N5amOD89yrA==; s=purelymail3; d=lkcamp.dev; v=1; bh=2nL+gJE/xUGOiECsRdkY2s0zPbV1/VkEl3IslBMeitQ=; h=Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=H1JgRu0i9rjs8jMpsoYZ6W+9wxQxg+2aS7L0IFMyz++04AEIZB+EfAnahidG4fG5IBlk+mmjs1iBt8draySacfkJBe9GUvh6RXIj3SVgxLFBQmKgJ+DKk8H1GglVRZm7nYs5loGXzZe67v9fPi38UVSAN4LJIOPXtzkgPgGBjbrVPPIfXr6WZShDny2YI/xNhJFVbLG8xGxG6uJYR0GmZ8maKVT7Gbmt4xgpKA+Wu+mELQPllllZpl9Rj8OO+1Wt4ard/i8TEobA3Iy990mYMNcHoNbeUqJhlgW4um34eWCfuswuLNT9LUCxfjLnGJmF0DttmOrRubX8JfjkowNQJQ==; s=purelymail3; d=purelymail.com; v=1; bh=2nL+gJE/xUGOiECsRdkY2s0zPbV1/VkEl3IslBMeitQ=; h=Feedback-ID:Received:From:To:Subject:Date; Feedback-ID: 40598:7130:null:purelymail X-Pm-Original-To: linux-fsdevel@vger.kernel.org Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 1095037770; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 22 Sep 2024 20:12:43 +0000 (UTC) From: Gabriela Bittencourt To: Gabriel Krisman Bertazi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, ~lkcamp/patches@lists.sr.ht Cc: porlando@lkcamp.dev, dpereira@lkcamp.dev Subject: [PATCH 2/2] unicode: kunit: change tests filename and path Date: Sun, 22 Sep 2024 17:16:31 -0300 Message-ID: <20240922201631.179925-3-gbittencourt@lkcamp.dev> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240922201631.179925-1-gbittencourt@lkcamp.dev> References: <20240922201631.179925-1-gbittencourt@lkcamp.dev> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail Change utf8 kunit test filename and path to follow the style convention on Documentation/dev-tools/kunit/style.rst Co-developed-by: Pedro Orlando Signed-off-by: Pedro Orlando Co-developed-by: Danilo Pereira Signed-off-by: Danilo Pereira Signed-off-by: Gabriela Bittencourt --- 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