From patchwork Tue Mar 21 12:50:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petri Latvala X-Patchwork-Id: 9636553 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8876E602CC for ; Tue, 21 Mar 2017 12:50:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A7D427C0B for ; Tue, 21 Mar 2017 12:50:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F6D428305; Tue, 21 Mar 2017 12:50:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0455E27C0B for ; Tue, 21 Mar 2017 12:50:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8599D8992E; Tue, 21 Mar 2017 12:50:22 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from johanna1.inet.fi (mta-out1.inet.fi [62.71.2.234]) by gabe.freedesktop.org (Postfix) with ESMTP id 99F946E581 for ; Tue, 21 Mar 2017 12:50:21 +0000 (UTC) RazorGate-KAS: Status: not_detected RazorGate-KAS: Rate: 0 RazorGate-KAS: Envelope from: RazorGate-KAS: Version: 5.5.3 RazorGate-KAS: LuaCore: 80 2014-11-10_18-01-23 260f8afb9361da3c7edfd3a8e3a4ca908191ad29 RazorGate-KAS: Lua profiles 69136 [Nov 12 2014] RazorGate-KAS: Method: none Received: from hufflepuff.adrinael.net (84.250.112.128) by johanna1.inet.fi (9.0.002.03-2-gbe5d057) id 58C29BB00171FA4F; Tue, 21 Mar 2017 14:50:20 +0200 Received: from adrinael by hufflepuff.adrinael.net with local (Exim 4.84_2) (envelope-from ) id 1cqJEy-0000oZ-QS; Tue, 21 Mar 2017 14:50:20 +0200 From: Petri Latvala To: intel-gfx@lists.freedesktop.org Date: Tue, 21 Mar 2017 14:50:10 +0200 Message-Id: <1490100610-3069-3-git-send-email-petri.latvala@intel.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1490100610-3069-1-git-send-email-petri.latvala@intel.com> References: <1490100610-3069-1-git-send-email-petri.latvala@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 3/3] lib/igt_kmod: Don't call igt_assert or igt_require without a fixture X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP 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 CC: Chris Wilson --- 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);