[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+GJov5iSJuQuk9=VMkxRKr+CYAmuZw9YHqydSJnG0HX0U2ASA@mail.gmail.com>
Date: Fri, 21 Jun 2024 17:03:10 -0400
From: Rae Moar <rmoar@...gle.com>
To: Ivan Orlov <ivan.orlov0322@...il.com>
Cc: brendan.higgins@...ux.dev, davidgow@...gle.com,
linux-kselftest@...r.kernel.org, kunit-dev@...glegroups.com,
linux-kernel@...r.kernel.org, skhan@...uxfoundation.org
Subject: Re: [PATCH v2 2/5] kunit: kunit-test: Remove stub for log tests
On Tue, Jun 18, 2024 at 1:03 PM Ivan Orlov <ivan.orlov0322@...il.com> wrote:
>
> Since now we are exporting string-stream functions into the KUnit
> namespace, we can safely use them in kunit-test when it is compiled as
> a module as well. So, remove the stubs used when kunit-test is compiled
> as a module. Import the KUnit namespace in the test.
>
> Reviewed-by: David Gow <davidgow@...gle.com>
> Signed-off-by: Ivan Orlov <ivan.orlov0322@...il.com>
Hello!
This seems good to me.
Reviewed-by: Rae Moar <rmoar@...gle.com>
Thanks!
-Rae
> ---
> V1 -> V2:
> - No changes
>
> lib/kunit/kunit-test.c | 18 +-----------------
> 1 file changed, 1 insertion(+), 17 deletions(-)
>
> diff --git a/lib/kunit/kunit-test.c b/lib/kunit/kunit-test.c
> index 37e02be1e710..d86f7cb3b3e4 100644
> --- a/lib/kunit/kunit-test.c
> +++ b/lib/kunit/kunit-test.c
> @@ -577,12 +577,6 @@ static struct kunit_suite kunit_resource_test_suite = {
> .test_cases = kunit_resource_test_cases,
> };
>
> -/*
> - * Log tests call string_stream functions, which aren't exported. So only
> - * build this code if this test is built-in.
> - */
> -#if IS_BUILTIN(CONFIG_KUNIT_TEST)
> -
> /* This avoids a cast warning if kfree() is passed direct to kunit_add_action(). */
> KUNIT_DEFINE_ACTION_WRAPPER(kfree_wrapper, kfree, const void *);
>
> @@ -637,17 +631,6 @@ static void kunit_log_newline_test(struct kunit *test)
> kunit_skip(test, "only useful when debugfs is enabled");
> }
> }
> -#else
> -static void kunit_log_test(struct kunit *test)
> -{
> - kunit_skip(test, "Log tests only run when built-in");
> -}
> -
> -static void kunit_log_newline_test(struct kunit *test)
> -{
> - kunit_skip(test, "Log tests only run when built-in");
> -}
> -#endif /* IS_BUILTIN(CONFIG_KUNIT_TEST) */
>
> static struct kunit_case kunit_log_test_cases[] = {
> KUNIT_CASE(kunit_log_test),
> @@ -872,4 +855,5 @@ kunit_test_suites(&kunit_try_catch_test_suite, &kunit_resource_test_suite,
> &kunit_fault_test_suite);
>
> MODULE_DESCRIPTION("KUnit test for core test infrastructure");
> +MODULE_IMPORT_NS(EXPORTED_FOR_KUNIT_TESTING);
> MODULE_LICENSE("GPL v2");
> --
> 2.34.1
>
Powered by blists - more mailing lists