From: Arpitha Raghunandan <98.arpi@gmail.com>
To: brendanhiggins@google.com, skhan@linuxfoundation.org,
andriy.shevchenko@linux.intel.com
Cc: kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [PATCH] lib: Convert test_uuid.c to KUnit
Date: Sat, 1 Aug 2020 11:04:01 +0530 [thread overview]
Message-ID: <4747b45c-0429-bf2e-8c64-3f4bc6b95749@gmail.com> (raw)
In-Reply-To: <20200730121656.45302-1-98.arpi@gmail.com>
On 30/07/20 5:46 pm, Arpitha Raghunandan wrote:
> Converts test lib/test_uuid.c to KUnit
>
> Signed-off-by: Arpitha Raghunandan <98.arpi@gmail.com>
> ---
> lib/Kconfig.debug | 7 +--
> lib/Makefile | 2 +-
> lib/{test_uuid.c => uuid_kunit.c} | 84 +++++++++----------------------
> 3 files changed, 28 insertions(+), 65 deletions(-)
> rename lib/{test_uuid.c => uuid_kunit.c} (48%)
>
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index f174f8887ae7..330c0d1de50b 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -2070,9 +2070,6 @@ config TEST_BITFIELD
>
> If unsure, say N.
>
> -config TEST_UUID
> - tristate "Test functions located in the uuid module at runtime"
> -
> config TEST_XARRAY
> tristate "Test the XArray code at runtime"
>
> @@ -2273,6 +2270,10 @@ config BITS_TEST
>
> If unsure, say N.
>
> +config UUID_KUNIT_TEST
> + tristate "KUnit test for functions located in the uuid module at runtime"
> + depends on KUNIT
> +
> config TEST_UDELAY
> tristate "udelay test driver"
> help
> diff --git a/lib/Makefile b/lib/Makefile
> index 032cc6c71a3a..62ef383c7563 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -81,7 +81,6 @@ obj-$(CONFIG_TEST_PRINTF) += test_printf.o
> obj-$(CONFIG_TEST_BITMAP) += test_bitmap.o
> obj-$(CONFIG_TEST_STRSCPY) += test_strscpy.o
> obj-$(CONFIG_TEST_BITFIELD) += test_bitfield.o
> -obj-$(CONFIG_TEST_UUID) += test_uuid.o
> obj-$(CONFIG_TEST_XARRAY) += test_xarray.o
> obj-$(CONFIG_TEST_PARMAN) += test_parman.o
> obj-$(CONFIG_TEST_KMOD) += test_kmod.o
> @@ -342,5 +341,6 @@ obj-$(CONFIG_PLDMFW) += pldmfw/
> obj-$(CONFIG_LIST_KUNIT_TEST) += list-test.o
> obj-$(CONFIG_LINEAR_RANGES_TEST) += test_linear_ranges.o
> obj-$(CONFIG_BITS_TEST) += test_bits.o
> +obj-$(CONFIG_UUID_KUNIT_TEST) += uuid_kunit.o
>
> obj-$(CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED) += devmem_is_allowed.o
> diff --git a/lib/test_uuid.c b/lib/uuid_kunit.c
> similarity index 48%
> rename from lib/test_uuid.c
> rename to lib/uuid_kunit.c
> index cd819c397dc7..f7f219ddecc2 100644
> --- a/lib/test_uuid.c
> +++ b/lib/uuid_kunit.c
> @@ -3,6 +3,7 @@
> */
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> +#include <kunit/test.h>
> #include <linux/init.h>
> #include <linux/kernel.h>
> #include <linux/module.h>
> @@ -39,95 +40,56 @@ static const char * const test_uuid_wrong_data[] = {
> "0cb4ddff-a545-4401-9d06-688af53e", /* not enough data */
> };
>
> -static unsigned total_tests __initdata;
> -static unsigned failed_tests __initdata;
> -
> -static void __init test_uuid_failed(const char *prefix, bool wrong, bool be,
> - const char *data, const char *actual)
> -{
> - pr_err("%s test #%u %s %s data: '%s'\n",
> - prefix,
> - total_tests,
> - wrong ? "passed on wrong" : "failed on",
> - be ? "BE" : "LE",
> - data);
> - if (actual && *actual)
> - pr_err("%s test #%u actual data: '%s'\n",
> - prefix,
> - total_tests,
> - actual);
> - failed_tests++;
> -}
> -
I have removed the above test_uuid_failed function while converting to KUnit, as mentioned earlier. Is this required?
prev parent reply other threads:[~2020-08-01 5:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-30 12:16 Arpitha Raghunandan
2020-07-31 5:50 ` Brendan Higgins
2020-07-31 10:02 ` Arpitha Raghunandan
2020-07-31 20:53 ` Brendan Higgins
2020-08-01 5:34 ` Arpitha Raghunandan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4747b45c-0429-bf2e-8c64-3f4bc6b95749@gmail.com \
--to=98.arpi@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=brendanhiggins@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®