From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 1/2] lib/igt_kmod: fill skip message for KUnit skips
Date: Thu, 15 Jun 2023 11:47:21 +0200 [thread overview]
Message-ID: <20230615094722.3756326-2-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20230615094722.3756326-1-mauro.chehab@linux.intel.com>
From: Mauro Carvalho Chehab <mchehab@kernel.org>
IGT build is currently complaining with the lack of a message for
igt_skip:
[188/1383] Compiling C object lib/libigt-igt_kmod_c.a.p/igt_kmod.c.o
../lib/igt_kmod.c: In function ‘__igt_kunit’:
../lib/igt_kmod.c:847:26: warning: zero-length gnu_printf format string [-Wformat-zero-length]
847 | igt_skip("");
| ^~
Add one.
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
lib/igt_kmod.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index 66c3028b3551..6205871791c3 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -763,7 +763,7 @@ static void __igt_kunit(const char *module_name, const char *opts)
int ret;
struct ktap_test_results *results;
struct ktap_test_results_element *temp;
- bool skip = false;
+ int skip = 0;
bool fail = false;
/* get normalized module name */
@@ -800,10 +800,15 @@ static void __igt_kunit(const char *module_name, const char *opts)
}
/* The KUnit module is required for running any KUnit tests */
- if (igt_kmod_load("kunit", NULL) != 0 ||
- kmod_module_new_from_name(kmod_ctx(), "kunit", &kunit_kmod) != 0) {
+ ret = igt_kmod_load("kunit", NULL);
+ if (ret) {
+ skip = ret;
+ goto unload;
+ }
+ ret = kmod_module_new_from_name(kmod_ctx(), "kunit", &kunit_kmod);
+ if (ret) {
igt_warn("Unable to load KUnit\n");
- skip = true;
+ skip = ret;
goto unload;
}
@@ -811,10 +816,11 @@ static void __igt_kunit(const char *module_name, const char *opts)
results = ktap_parser_start(f, is_builtin);
- if (igt_kmod_load(module_name, opts) != 0) {
+ ret = igt_kmod_load(module_name, opts);
+ if (ret) {
+ skip = ret;
igt_warn("Unable to load %s module\n", module_name);
ret = ktap_parser_stop();
- skip = true;
goto unload;
}
@@ -844,7 +850,7 @@ unload:
igt_ktest_fini(&tst);
if (skip)
- igt_skip("");
+ igt_skip("Skipping test, as probing KUnit module returned %d", skip);
if (fail)
igt_fail(IGT_EXIT_ABORT);
--
2.40.1
next prev parent reply other threads:[~2023-06-15 9:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-15 9:47 [igt-dev] [PATCH i-g-t 0/2] Enable Xe KUnit tests and fix a warning Mauro Carvalho Chehab
2023-06-15 9:47 ` Mauro Carvalho Chehab [this message]
2023-06-15 10:47 ` [igt-dev] [PATCH i-g-t 1/2] lib/igt_kmod: fill skip message for KUnit skips Kamil Konieczny
2023-06-15 9:47 ` [igt-dev] [PATCH i-g-t 2/2] intel-ci: add Xe live KUnit tests to BAT testlist Mauro Carvalho Chehab
2023-06-15 10:51 ` Kamil Konieczny
2023-06-15 10:33 ` [igt-dev] [PATCH i-g-t 0/2] Enable Xe KUnit tests and fix a warning Dec, Katarzyna
2023-06-15 11:22 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2023-06-15 12:49 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-06-15 17:03 ` [igt-dev] ✗ Fi.CI.BUILD: failure for Enable Xe KUnit tests and fix a warning (rev2) 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=20230615094722.3756326-2-mauro.chehab@linux.intel.com \
--to=mauro.chehab@linux.intel.com \
--cc=igt-dev@lists.freedesktop.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