Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2623373rwe; Sun, 28 Aug 2022 17:29:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR6futwqyIwyCO/IZg2tTP4f1+D0fh7CBHzFfByzD6zbygfM9BWLwQByFDolW9ChLiaUlyvV X-Received: by 2002:a63:dd41:0:b0:42b:1634:76cd with SMTP id g1-20020a63dd41000000b0042b163476cdmr11608975pgj.460.1661732989657; Sun, 28 Aug 2022 17:29:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661732989; cv=none; d=google.com; s=arc-20160816; b=RO5M1fqRGB6uMVvad8DqgiReFDG+zRoy1mM78LTQcQ3WhDm+rKD5x/M4UnYjuM4hlw 51aTy64Y0t1JbpC/fvh4HCJysAzFXM6PzPdREeemv+102+g77IA0TJkWcIVGpuzTIEn6 xzoD+uHRlOQAzPSzvcWirnd0Q6ryPUlSfuLvgnRONnWTiokWEHtTPooiyeTaMfUBbbih BWoh4jQBgOzQFysdsrnHkK7d+5bt9ciaz7z60OLN9cMCMnCAbSiuRvLijVPxrJ26lS8l /faTeAgvLYThDVPW9+VoZeKa9EJaZ1O7cMMbwXCrlOOzmUmjN7TP8FClWXzMqxtK3gV2 Y0bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QmTBXn4baR5+Elke2o0fwEHMQR7HJhR+LT2U+fc1O/A=; b=MFKwohdfhwjuix25CgYYl8WyguhdwD+X8rYwlIavrwZI14tacBViBYUOOn+whecbSt ACnPdFYNxfC3f9fPnDvZygdKw0gbus2Y5Kyp2X5y6FZWmKiwGCV/lwjPE2yOmZ77nyzv l2oFfyNmNsJOJqdfpHjo2PU4JEr1JdlMblTozPTowtNh+gW9JN7RZE5vLJCgk+OzT8aS Q9pI41Rk1CasLjIIxTX6dI4AiqJjFOGONz+HW0dnLWqM19YQrHYNJAn8eP+wQdGQ7DiJ g81jk3iV0TpVGkAcwHbd/qbzGcF4GsIKAeYQwvvBUhIInPRueVEZv7gbPbd+/xG3OOcN VWaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@riseup.net header.s=squak header.b=h5tUqD2Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=riseup.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n2-20020a170902d2c200b001730dd7041asi2116900plc.564.2022.08.28.17.29.38; Sun, 28 Aug 2022 17:29:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@riseup.net header.s=squak header.b=h5tUqD2Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=riseup.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229513AbiH2AJw (ORCPT + 99 others); Sun, 28 Aug 2022 20:09:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229379AbiH2AJt (ORCPT ); Sun, 28 Aug 2022 20:09:49 -0400 Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99A4E2734; Sun, 28 Aug 2022 17:09:48 -0700 (PDT) Received: from mx0.riseup.net (mx0-pn.riseup.net [10.0.1.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx0.riseup.net", Issuer "R3" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4MG9mX1DtHzDr8x; Mon, 29 Aug 2022 00:09:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1661731788; bh=ThcwD+/ARB/097HCNk/WNN4lmuiNd29bmbeq+JVzaCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h5tUqD2ZwNaJzFNdPNOm/AWpG+I3jFVLHriqritRMoIf/WVAKnrZN6U7hIN+UE8gd C0qNJA8Y/jtfzZG2Z7ykTjnjUzI5C+yT4VJhUG1bcwiw4x9zyS9ZTJVYQjThvjt0OS 8hwgQyzed8NVDotjysWRmhHoRDX2INC1EUNlPwFc= Received: from fews1.riseup.net (fews1-pn.riseup.net [10.0.1.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx0.riseup.net (Postfix) with ESMTPS id 4MG9mV3Bksz9sNj; Mon, 29 Aug 2022 00:09:46 +0000 (UTC) X-Riseup-User-ID: 1F040BCC012FFF67A8C1706CE96F24ADEEA8BC2421AAF385962892E6DB1139C9 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4MG9mP0Z0Tz5vTc; Mon, 29 Aug 2022 00:09:40 +0000 (UTC) From: Isabella Basso To: igt-dev@lists.freedesktop.org Cc: magalilemes00@gmail.com, maira.canal@usp.br, tales.aparecida@gmail.com, rodrigo.siqueira@amd.com, mwen@igalia.com, andrealmeid@riseup.net, twoerner@gmail.com, leandro.ribeiro@collabora.com, n@nfraprado.net, kunit-dev@googlegroups.com, davidgow@google.com, dlatypov@google.com, brendanhiggins@google.com, daniel@ffwll.ch, skhan@linuxfoundation.org, linux-kselftest@vger.kernel.org, dri-devel@lists.freedesktop.org, daniel@fooishbar.org, linux-kernel@vger.kernel.org, Isabella Basso Subject: [PATCH i-g-t v2 1/4] lib/igt_kmod: rename kselftest functions to ktest Date: Sun, 28 Aug 2022 21:09:17 -0300 Message-Id: <20220829000920.38185-2-isabbasso@riseup.net> In-Reply-To: <20220829000920.38185-1-isabbasso@riseup.net> References: <20220829000920.38185-1-isabbasso@riseup.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This aims at making IGT's structure more general to different kernel testing frameworks such as KUnit, as they use a lot of the same functionality. Signed-off-by: Isabella Basso --- lib/igt_kmod.c | 22 +++++++++++----------- lib/igt_kmod.h | 12 ++++++------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c index bcf7dfeb..bb6cb7bb 100644 --- a/lib/igt_kmod.c +++ b/lib/igt_kmod.c @@ -718,8 +718,8 @@ static int open_parameters(const char *module_name) return open(path, O_RDONLY); } -int igt_kselftest_init(struct igt_kselftest *tst, - const char *module_name) +int igt_ktest_init(struct igt_ktest *tst, + const char *module_name) { int err; @@ -738,7 +738,7 @@ int igt_kselftest_init(struct igt_kselftest *tst, return 0; } -int igt_kselftest_begin(struct igt_kselftest *tst) +int igt_ktest_begin(struct igt_ktest *tst) { int err; @@ -753,7 +753,7 @@ int igt_kselftest_begin(struct igt_kselftest *tst) return 0; } -int igt_kselftest_execute(struct igt_kselftest *tst, +int igt_kselftest_execute(struct igt_ktest *tst, struct igt_kselftest_list *tl, const char *options, const char *result) @@ -791,13 +791,13 @@ int igt_kselftest_execute(struct igt_kselftest *tst, return err; } -void igt_kselftest_end(struct igt_kselftest *tst) +void igt_ktest_end(struct igt_ktest *tst) { kmod_module_remove_module(tst->kmod, KMOD_REMOVE_FORCE); close(tst->kmsg); } -void igt_kselftest_fini(struct igt_kselftest *tst) +void igt_ktest_fini(struct igt_ktest *tst) { free(tst->module_name); kmod_module_unref(tst->kmod); @@ -820,15 +820,15 @@ void igt_kselftests(const char *module_name, const char *result, const char *filter) { - struct igt_kselftest tst; + struct igt_ktest tst; IGT_LIST_HEAD(tests); struct igt_kselftest_list *tl, *tn; - if (igt_kselftest_init(&tst, module_name) != 0) + if (igt_ktest_init(&tst, module_name) != 0) return; igt_fixture - igt_require(igt_kselftest_begin(&tst) == 0); + igt_require(igt_ktest_begin(&tst) == 0); igt_kselftest_get_tests(tst.kmod, filter, &tests); igt_subtest_with_dynamic(filter ?: "all") { @@ -847,9 +847,9 @@ void igt_kselftests(const char *module_name, } igt_fixture { - igt_kselftest_end(&tst); + igt_ktest_end(&tst); igt_require(!igt_list_empty(&tests)); } - igt_kselftest_fini(&tst); + igt_ktest_fini(&tst); } diff --git a/lib/igt_kmod.h b/lib/igt_kmod.h index f98dd29f..ceb10cd0 100644 --- a/lib/igt_kmod.h +++ b/lib/igt_kmod.h @@ -50,7 +50,7 @@ void igt_kselftests(const char *module_name, const char *result_option, const char *filter); -struct igt_kselftest { +struct igt_ktest { struct kmod_module *kmod; char *module_name; int kmsg; @@ -63,19 +63,19 @@ struct igt_kselftest_list { char param[]; }; -int igt_kselftest_init(struct igt_kselftest *tst, +int igt_ktest_init(struct igt_ktest *tst, const char *module_name); -int igt_kselftest_begin(struct igt_kselftest *tst); +int igt_ktest_begin(struct igt_ktest *tst); void igt_kselftest_get_tests(struct kmod_module *kmod, const char *filter, struct igt_list_head *tests); -int igt_kselftest_execute(struct igt_kselftest *tst, +int igt_kselftest_execute(struct igt_ktest *tst, struct igt_kselftest_list *tl, const char *module_options, const char *result); -void igt_kselftest_end(struct igt_kselftest *tst); -void igt_kselftest_fini(struct igt_kselftest *tst); +void igt_ktest_end(struct igt_ktest *tst); +void igt_ktest_fini(struct igt_ktest *tst); #endif /* IGT_KMOD_H */ -- 2.37.2