From: Petri Latvala <petri.latvala@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t 3/3] lib/igt_kmod: Don't call igt_assert or igt_require without a fixture
Date: Tue, 21 Mar 2017 14:50:10 +0200 [thread overview]
Message-ID: <1490100610-3069-3-git-send-email-petri.latvala@intel.com> (raw)
In-Reply-To: <1490100610-3069-1-git-send-email-petri.latvala@intel.com>
If kmod_module_new_from_name fails, igt_kselftest ends up calling
igt_skip (through igt_require) when not in a fixture. Instead return
normally from igt_kselftest, matching behaviour when the module
loading is successful but it doesn't contain selftests.
Also change one igt_assert to a return for the same reason.
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
CC: Chris Wilson <chris@chris-wilson.co.uk>
---
lib/igt_kmod.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index 4b8ea81..b366ade 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -419,7 +419,8 @@ int igt_kselftest_init(struct igt_kselftest *tst,
memset(tst, 0, sizeof(*tst));
tst->module_name = strdup(module_name);
- igt_assert(tst->module_name);
+ if (!tst->module_name)
+ return 1;
tst->kmsg = -1;
@@ -502,7 +503,9 @@ void igt_kselftests(const char *module_name,
IGT_LIST(tests);
struct igt_kselftest_list *tl, *tn;
- igt_require(igt_kselftest_init(&tst, module_name) == 0);
+ if (igt_kselftest_init(&tst, module_name) != 0)
+ return;
+
igt_fixture
igt_require(igt_kselftest_begin(&tst) == 0);
--
2.9.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2017-03-21 12:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-21 12:50 [PATCH i-g-t 1/3] igt_command_line.sh: Handle the special cases of drv_selftest and drm_mm Petri Latvala
2017-03-21 12:50 ` [PATCH i-g-t 2/3] igt_command_line.sh: Actually check things during distcheck Petri Latvala
2017-03-21 12:50 ` Petri Latvala [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=1490100610-3069-3-git-send-email-petri.latvala@intel.com \
--to=petri.latvala@intel.com \
--cc=intel-gfx@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;
as well as URLs for NNTP newsgroup(s).