linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Isabella Basso <isabbasso@riseup.net>
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 <isabbasso@riseup.net>
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	[thread overview]
Message-ID: <20220829000920.38185-2-isabbasso@riseup.net> (raw)
In-Reply-To: <20220829000920.38185-1-isabbasso@riseup.net>

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 <isabbasso@riseup.net>
---
 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


  reply	other threads:[~2022-08-29  0:10 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-29  0:09 [PATCH i-g-t v2 0/4] Add support for KUnit tests Isabella Basso
2022-08-29  0:09 ` Isabella Basso [this message]
2022-09-09 15:05   ` [igt-dev] [PATCH i-g-t v2 1/4] lib/igt_kmod: rename kselftest functions to ktest Janusz Krzysztofik
2022-08-29  0:09 ` [PATCH i-g-t v2 2/4] lib/igt_kmod.c: check if module is builtin before attempting to unload it Isabella Basso
2022-09-09 15:10   ` [igt-dev] " Janusz Krzysztofik
2022-08-29  0:09 ` [PATCH i-g-t v2 3/4] lib/igt_kmod: add compatibility for KUnit Isabella Basso
2022-09-01  6:37   ` David Gow
2022-09-19 20:43     ` Isabella Basso
2022-09-20  0:25       ` Daniel Latypov
2022-11-01 12:43         ` [igt-dev] " Mauro Carvalho Chehab
2022-11-01 12:33       ` Mauro Carvalho Chehab
2022-11-01 17:17         ` Isabella Basso
2022-11-01 18:03           ` Mauro Carvalho Chehab
2022-11-01 12:29     ` Mauro Carvalho Chehab
2022-09-09 15:18   ` Janusz Krzysztofik
2022-09-19 20:55     ` Isabella Basso
2023-02-10 14:56       ` Janusz Krzysztofik
2023-02-10 16:55         ` Isabella Basso
2023-02-14  9:50           ` Janusz Krzysztofik
2022-11-03  9:48   ` Mauro Carvalho Chehab
2022-11-03 11:40     ` Mauro Carvalho Chehab
2022-11-03 12:35       ` Petri Latvala
2022-11-03 14:57     ` Mauro Carvalho Chehab
2022-08-29  0:09 ` [PATCH i-g-t v2 4/4] tests: DRM selftests: switch to KUnit Isabella Basso
2022-09-20  8:18   ` [igt-dev] " Petri Latvala
2022-11-01 12:54     ` Mauro Carvalho Chehab
2022-11-01 13:16       ` Petri Latvala
2022-11-01 13:53         ` Mauro Carvalho Chehab
2022-11-01 14:04           ` Daniel Latypov
2022-09-09 14:49 ` [igt-dev] [PATCH i-g-t v2 0/4] Add support for KUnit tests Janusz Krzysztofik

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=20220829000920.38185-2-isabbasso@riseup.net \
    --to=isabbasso@riseup.net \
    --cc=andrealmeid@riseup.net \
    --cc=brendanhiggins@google.com \
    --cc=daniel@ffwll.ch \
    --cc=daniel@fooishbar.org \
    --cc=davidgow@google.com \
    --cc=dlatypov@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kunit-dev@googlegroups.com \
    --cc=leandro.ribeiro@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=magalilemes00@gmail.com \
    --cc=maira.canal@usp.br \
    --cc=mwen@igalia.com \
    --cc=n@nfraprado.net \
    --cc=rodrigo.siqueira@amd.com \
    --cc=skhan@linuxfoundation.org \
    --cc=tales.aparecida@gmail.com \
    --cc=twoerner@gmail.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;
as well as URLs for NNTP newsgroup(s).