From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
Isabella Basso <isabbasso@riseup.net>,
intel-xe@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t v2 16/17] lib/kunit: Strip "_test" or "_kunit" suffix from subtest names
Date: Fri, 15 Sep 2023 13:42:13 +0200 [thread overview]
Message-ID: <20230915134213.12acd997@maurocar-mobl2> (raw)
In-Reply-To: <20230908123233.137134-35-janusz.krzysztofik@linux.intel.com>
On Fri, 8 Sep 2023 14:32:50 +0200
Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> wrote:
> If a user (an IGT test) doesn't provide a subtest name when calling
> igt_kunit() then we now use the requested kernel module name as IGT
> subtest name. Since names of kunit test modules usually end with a
> "_test" or "_kunit" suffix, those parts of the names don't carry any
> useful information. Strip those suffixes from IGT subtest names.
LGTM.
Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>
>
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> ---
> lib/igt_kmod.c | 26 ++++++++++++++++++++++----
> tests/drm_mm.c | 42 +++++++++++++++++++++---------------------
> 2 files changed, 43 insertions(+), 25 deletions(-)
>
> diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
> index 46a6f81e73..ddd5499f5e 100644
> --- a/lib/igt_kmod.c
> +++ b/lib/igt_kmod.c
> @@ -944,8 +944,29 @@ void igt_kunit(const char *module_name, const char *name, const char *opts)
> if (igt_ktest_init(&tst, module_name) != 0)
> return;
>
> - igt_fixture
> + /*
> + * If the caller (an IGT test) provides no subtest name then we
> + * take the module name, drop the trailing "_test" or "_kunit"
> + * suffix, if any, and use the result as our IGT subtest name.
> + */
> + if (!name) {
> + name = strdup(module_name);
> + if (name) {
> + char *suffix = strstr(name, "_test");
> +
> + if (!suffix)
> + suffix = strstr(name, "_kunit");
> +
> + if (suffix)
> + *suffix = '\0';
> + }
> + }
> +
> + igt_fixture {
> + igt_require(name);
> +
> igt_require(igt_ktest_begin(&tst) == 0);
> + }
>
> /*
> * We need to use igt_subtest here, as otherwise it may crash with:
> @@ -954,9 +975,6 @@ void igt_kunit(const char *module_name, const char *name, const char *opts)
> * proper namespace for dynamic subtests, with is required for CI
> * and for documentation.
> */
> - if (name == NULL)
> - name = module_name;
> -
> igt_subtest_with_dynamic(name)
> __igt_kunit(&tst, opts);
>
> diff --git a/tests/drm_mm.c b/tests/drm_mm.c
> index 9a8b3f3fcb..e6ba224745 100644
> --- a/tests/drm_mm.c
> +++ b/tests/drm_mm.c
> @@ -29,123 +29,123 @@
> * Feature: mapping
> * Run type: FULL
> *
> - * SUBTEST: drm_mm_test
> + * SUBTEST: drm_mm
> *
> - * SUBTEST: drm_mm_test@align
> + * SUBTEST: drm_mm@align
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@align32
> + * SUBTEST: drm_mm@align32
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@align64
> + * SUBTEST: drm_mm@align64
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@bottomup
> + * SUBTEST: drm_mm@bottomup
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@color
> + * SUBTEST: drm_mm@color
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@color_evict
> + * SUBTEST: drm_mm@color_evict
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@color_evict_range
> + * SUBTEST: drm_mm@color_evict_range
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@debug
> + * SUBTEST: drm_mm@debug
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@evict
> + * SUBTEST: drm_mm@evict
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@evict_range
> + * SUBTEST: drm_mm@evict_range
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@frag
> + * SUBTEST: drm_mm@frag
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@highest
> + * SUBTEST: drm_mm@highest
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@init
> + * SUBTEST: drm_mm@init
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@insert
> + * SUBTEST: drm_mm@insert
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@insert_range
> + * SUBTEST: drm_mm@insert_range
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@lowest
> + * SUBTEST: drm_mm@lowest
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@replace
> + * SUBTEST: drm_mm@replace
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@reserve
> + * SUBTEST: drm_mm@reserve
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@sanitycheck
> + * SUBTEST: drm_mm@sanitycheck
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
> * Test category: GEM_Legacy
> *
> - * SUBTEST: drm_mm_test@topdown
> + * SUBTEST: drm_mm@topdown
> * Category: Infrastructure
> * Description: drm_mm range manager SW validation
> * Functionality: DRM memory mangemnt
next prev parent reply other threads:[~2023-09-15 11:42 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-08 12:32 [igt-dev] [PATCH i-g-t v2 00/17] Fix IGT Kunit implementation issues Janusz Krzysztofik
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 01/17] lib/kunit: Drop unused file stream Janusz Krzysztofik
2023-09-15 10:36 ` Mauro Carvalho Chehab
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 02/17] lib/kunit: Stop loading kunit module explicitly Janusz Krzysztofik
2023-09-15 10:36 ` Mauro Carvalho Chehab
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 03/17] lib/kunit: Fix struct kmod_module kunit_kmod not freed Janusz Krzysztofik
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 04/17] lib/kunit: Optimize calls to igt_success/skip/fail() Janusz Krzysztofik
2023-09-11 8:49 ` [igt-dev] [Intel-gfx] " Mauro Carvalho Chehab
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 05/17] lib/kunit: Fix illegal igt_fail() calls inside subtest body Janusz Krzysztofik
2023-09-11 8:52 ` [igt-dev] [Intel-gfx] " Mauro Carvalho Chehab
2023-09-11 9:28 ` Janusz Krzysztofik
2023-09-11 11:57 ` Mauro Carvalho Chehab
2023-09-13 13:03 ` Janusz Krzysztofik
2023-09-15 9:58 ` Mauro Carvalho Chehab
2023-09-15 10:08 ` Janusz Krzysztofik
2023-09-15 12:13 ` Mauro Carvalho Chehab
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 06/17] lib/ktap: Make sure we fail on premature cancel Janusz Krzysztofik
2023-09-11 8:55 ` [igt-dev] [Intel-gfx] " Mauro Carvalho Chehab
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 07/17] lib/ktap: Don't ignore interrupt signals Janusz Krzysztofik
2023-09-11 9:01 ` [igt-dev] [Intel-gfx] " Mauro Carvalho Chehab
2023-09-13 14:04 ` Janusz Krzysztofik
2023-09-15 12:25 ` Mauro Carvalho Chehab
2023-09-15 13:06 ` Janusz Krzysztofik
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 08/17] lib/kunit: Cancel KTP parser on module load failure Janusz Krzysztofik
2023-09-11 9:02 ` [igt-dev] [Intel-gfx] " Mauro Carvalho Chehab
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 09/17] lib/ktap: Drop is_running flag Janusz Krzysztofik
2023-09-11 9:03 ` [igt-dev] [Intel-gfx] " Mauro Carvalho Chehab
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 10/17] lib/ktap: Read /dev/kmsg in blocking mode Janusz Krzysztofik
2023-09-15 10:42 ` [igt-dev] [Intel-gfx] " Mauro Carvalho Chehab
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 11/17] lib/kunit: Fail / skip on kernel taint Janusz Krzysztofik
2023-09-15 10:43 ` [igt-dev] [Intel-gfx] " Mauro Carvalho Chehab
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 12/17] lib/ktap: Use IGT linked lists for storing KTAP results Janusz Krzysztofik
2023-09-15 10:44 ` [igt-dev] [Intel-gfx] " Mauro Carvalho Chehab
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 13/17] lib/ktap: Reimplement KTAP parser Janusz Krzysztofik
2023-09-15 11:45 ` Mauro Carvalho Chehab
2023-09-15 12:28 ` [igt-dev] [Intel-gfx] " Mauro Carvalho Chehab
2023-09-15 13:09 ` Janusz Krzysztofik
2023-09-15 13:35 ` [Intel-xe] " Janusz Krzysztofik
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 14/17] lib/kunit: Load test modules in background Janusz Krzysztofik
2023-09-15 12:11 ` Mauro Carvalho Chehab
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 15/17] lib/kunit: Parse KTAP report from the main process thread Janusz Krzysztofik
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 16/17] lib/kunit: Strip "_test" or "_kunit" suffix from subtest names Janusz Krzysztofik
2023-09-15 11:42 ` Mauro Carvalho Chehab [this message]
2023-09-08 12:32 ` [igt-dev] [PATCH i-g-t v2 17/17] lib/kunit: Omit suite name prefix if the same as subtest name Janusz Krzysztofik
2023-09-08 14:08 ` [igt-dev] ✗ GitLab.Pipeline: warning for Fix IGT Kunit implementation issues (rev2) Patchwork
2023-09-08 14:46 ` [igt-dev] ✗ Fi.CI.BAT: failure " Patchwork
2023-09-08 15:51 ` [igt-dev] ✓ CI.xeBAT: success " Patchwork
2023-09-11 12:26 ` [igt-dev] ✓ Fi.CI.BAT: " Patchwork
2023-09-11 14:57 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
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=20230915134213.12acd997@maurocar-mobl2 \
--to=mauro.chehab@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=isabbasso@riseup.net \
--cc=janusz.krzysztofik@linux.intel.com \
/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