Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v2 7/7] runner/runner_tests: add a test to check case-insensitive match
Date: Mon, 30 Oct 2023 10:50:02 +0100	[thread overview]
Message-ID: <20231030095206.108025-8-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20231030095206.108025-1-mauro.chehab@linux.intel.com>

From: Mauro Carvalho Chehab <mchehab@kernel.org>

As regular expressions are now case-insensitive, add ab
unit test to verify that case-insensitive logic is working
as expected.

CC: Petri Latvala <adrinael@adrinael.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
 runner/runner_tests.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/runner/runner_tests.c b/runner/runner_tests.c
index 11ff05bc0e7e..0aa7dd6626b7 100644
--- a/runner/runner_tests.c
+++ b/runner/runner_tests.c
@@ -1813,13 +1813,16 @@ igt_main
 	igt_subtest_group {
 		const char testlisttext[] = "igt@successtest";
 		const char blocktext[] = "igt@successtest@first";
+		const char blocktext_upper[] = "igt@successTEST@first";
 		struct job_list *list = malloc(sizeof(*list));
 		volatile int dirfd = -1;
 		char dirname[] = "tmpdirXXXXXX";
 		volatile int listfd;
 		volatile int blockfd;
+		volatile int blockfd_upper;
 		char listfilename[] = "tmplistXXXXXX";
 		char blockfilename[] = "tmpblockXXXXXX";
+		char blockfilename_upper[] = "tmpBLOCKXXXXXX";
 
 		igt_fixture {
 			igt_require(mkdtemp(dirname) != NULL);
@@ -1829,8 +1832,11 @@ igt_main
 			igt_require(write(listfd, testlisttext, strlen(testlisttext)) == strlen(testlisttext));
 			igt_require((blockfd = mkstemp(blockfilename)) >= 0);
 			igt_require(write(blockfd, blocktext, strlen(blocktext)) == strlen(blocktext));
+			igt_require((blockfd_upper = mkstemp(blockfilename_upper)) >= 0);
+			igt_require(write(blockfd_upper, blocktext_upper, strlen(blocktext_upper)) == strlen(blocktext_upper));
 			close(listfd);
 			close(blockfd);
+			close(blockfd_upper);
 
 			init_job_list(list);
 		}
@@ -1870,9 +1876,28 @@ igt_main
 			igt_assert_eqstr(list->entries[0].subtests[0], "second-subtest");
 		}
 
+		igt_subtest("only-binary-name-in-testlist-with-case-insensitive-blocklist") {
+			const char *argv[] = { "runner",
+				"--allow-non-root",
+				"--test-list", listfilename,
+				"-b", blockfilename_upper,
+				testdatadir,
+				dirname,
+			};
+
+			igt_assert(parse_options(ARRAY_SIZE(argv), (char**)argv, settings));
+
+			igt_assert(create_job_list(list, settings));
+			/* No multi-mode, binary has two subtests, one of them blocked */
+			igt_assert_eq(list->size, 1);
+			igt_assert_eq(list->entries[0].subtest_count, 1);
+			igt_assert_eqstr(list->entries[0].subtests[0], "second-subtest");
+		}
+
 		igt_fixture {
 			unlink(listfilename);
 			unlink(blockfilename);
+			unlink(blockfilename_upper);
 			close(dirfd);
 			clear_directory(dirname);
 			free_job_list(list);
-- 
2.41.0

  parent reply	other threads:[~2023-10-30  9:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30  9:49 [igt-dev] [PATCH i-g-t v2 0/7] better sync test_list.py with igt_runner Mauro Carvalho Chehab
2023-10-30  9:49 ` [igt-dev] [PATCH i-g-t v2 1/7] runner: Normalize testlist entries that don't list subtests Mauro Carvalho Chehab
2023-10-30  9:49 ` [igt-dev] [PATCH i-g-t v2 2/7] runner/runner_tests: Unit tests for binary-name-only testlist entries Mauro Carvalho Chehab
2023-10-30 12:47   ` Kamil Konieczny
2023-10-30  9:49 ` [igt-dev] [PATCH i-g-t v2 3/7] runner/runner_tests: Fix name of no-subtests in unit tests Mauro Carvalho Chehab
2023-10-30 12:48   ` Kamil Konieczny
2023-10-30  9:49 ` [igt-dev] [PATCH i-g-t v2 4/7] igt_runner: don't require root for dry_run Mauro Carvalho Chehab
2023-10-30  9:50 ` [igt-dev] [PATCH i-g-t v2 5/7] scripts/test_list.py: better handle list of tests Mauro Carvalho Chehab
2023-10-30  9:50 ` [igt-dev] [PATCH i-g-t v2 6/7] runner/job_list: use case-insensitive regular expressions Mauro Carvalho Chehab
2023-10-30  9:50 ` Mauro Carvalho Chehab [this message]
2023-10-30 12:38   ` [igt-dev] [PATCH i-g-t v2 7/7] runner/runner_tests: add a test to check case-insensitive match Kamil Konieczny
2023-10-30 17:04 ` [igt-dev] ✓ CI.xeBAT: success for better sync test_list.py with igt_runner (rev2) Patchwork
2023-10-30 17:08 ` [igt-dev] ✗ Fi.CI.BAT: failure " 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=20231030095206.108025-8-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