From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v4 02/11] scripts/test_list.py: rename the internal summary value
Date: Thu, 31 Aug 2023 16:52:04 +0200 [thread overview]
Message-ID: <20230831145509.477543-3-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20230831145509.477543-1-mauro.chehab@linux.intel.com>
From: Mauro Carvalho Chehab <mchehab@kernel.org>
The sumary is used internally. So, it is not meant to be used as
a normal field. To avoid possible clashes in the future, rename
the internal usage to _summary_, as we're using _foo_ for internal
properties.
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
scripts/test_list.py | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/scripts/test_list.py b/scripts/test_list.py
index f843c7a2a4f6..415394c017b9 100755
--- a/scripts/test_list.py
+++ b/scripts/test_list.py
@@ -429,8 +429,8 @@ class TestList:
for subtest in self.doc[test]["subtest"].keys():
summary = test_name
- if self.doc[test]["subtest"][subtest]["Summary"] != '':
- summary += self.subtest_separator + self.doc[test]["subtest"][subtest]["Summary"]
+ if self.doc[test]["subtest"][subtest]["_summary_"] != '':
+ summary += self.subtest_separator + self.doc[test]["subtest"][subtest]["_summary_"]
if not summary:
continue
@@ -441,10 +441,10 @@ class TestList:
if num_vars == 0:
subtest_dict = {}
- subtest_dict["Summary"] = summary
+ subtest_dict["_summary_"] = summary
for k in sorted(self.doc[test]["subtest"][subtest].keys()):
- if k in [ 'Summary', 'arg', 'subtest_line' ]:
+ if k in [ '_summary_', 'arg', 'subtest_line' ]:
continue
if not allow_inherit:
@@ -510,10 +510,10 @@ class TestList:
# Store the element
subtest_dict = {}
- subtest_dict["Summary"] = arg_summary
+ subtest_dict["_summary_"] = arg_summary
for field in sorted(self.doc[test]["subtest"][subtest].keys()):
- if field in [ 'Summary', 'arg', 'subtest_line' ]:
+ if field in [ '_summary_', 'arg', 'subtest_line' ]:
continue
sub_field = self.doc[test]["subtest"][subtest][field]
@@ -581,11 +581,11 @@ class TestList:
if self.__filter_subtest(self.doc[test], subtest, True):
continue
- summary = subtest["Summary"]
+ summary = subtest["_summary_"]
dic[summary] = {}
for field in sorted(subtest.keys()):
- if field in [ 'Summary', 'arg', 'subtest_line' ]:
+ if field in [ '_summary_', 'arg', 'subtest_line' ]:
continue
dic[summary][field] = subtest[field]
@@ -646,12 +646,12 @@ class TestList:
for subtest in subtest_array:
print()
- print(subtest["Summary"])
- print(len(subtest["Summary"]) * '=')
+ print(subtest["_summary_"])
+ print(len(subtest["_summary_"]) * '=')
print("")
for field in sorted(subtest.keys()):
- if field in [ 'Summary', 'arg', 'subtest_line' ]:
+ if field in [ '_summary_', 'arg', 'subtest_line' ]:
continue
print(f":{field}:", subtest[field])
@@ -857,7 +857,7 @@ class TestList:
subtest_array += self.expand_subtest(fname, test_name, test, True)
- subtest_array.sort(key = lambda x : x.get('Summary'))
+ subtest_array.sort(key = lambda x : x.get('_summary_'))
for subtest in subtest_array:
if self.__filter_subtest(self.doc[test], subtest, True):
@@ -873,27 +873,27 @@ class TestList:
if test_elem not in subtests:
subtests[test_elem] = []
if order:
- subtests[test_elem].append((subtest["Summary"], test_list))
+ subtests[test_elem].append((subtest["_summary_"], test_list))
else:
- subtests[test_elem].append(subtest["Summary"])
+ subtests[test_elem].append(subtest["_summary_"])
else:
if subtest[sort_field] not in subtests:
subtests[subtest[sort_field]] = []
if order:
- subtests[test_elem].append((subtest["Summary"], [subtest[sort_field]]))
+ subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
else:
- subtests[subtest[sort_field]].append(subtest["Summary"])
+ subtests[subtest[sort_field]].append(subtest["_summary_"])
else:
if order:
- subtests[test_elem].append((subtest["Summary"], [subtest[sort_field]]))
+ subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
else:
- subtests[""].append(subtest["Summary"])
+ subtests[""].append(subtest["_summary_"])
else:
if order:
- subtests[test_elem].append((subtest["Summary"], [subtest[sort_field]]))
+ subtests[test_elem].append((subtest["_summary_"], [subtest[sort_field]]))
else:
- subtests[""].append(subtest["Summary"])
+ subtests[""].append(subtest["_summary_"])
if order:
for group, tests in subtests.items():
@@ -1078,7 +1078,7 @@ class TestList:
self.doc[current_test] = {}
self.doc[current_test]["arg"] = {}
- self.doc[current_test]["Summary"] = match.group(1)
+ self.doc[current_test]["_summary_"] = match.group(1)
self.doc[current_test]["File"] = fname
self.doc[current_test]["subtest"] = {}
self.doc[current_test]["subtest_line"] = {}
@@ -1116,7 +1116,7 @@ class TestList:
continue
self.doc[current_test]["subtest"][current_subtest][field] = self.doc[current_test][field]
- self.doc[current_test]["subtest"][current_subtest]["Summary"] = match.group(1)
+ self.doc[current_test]["subtest"][current_subtest]["_summary_"] = match.group(1)
self.doc[current_test]["subtest"][current_subtest]["Description"] = ''
self.doc[current_test]["subtest_line"][current_subtest] = file_ln
--
2.41.0
next prev parent reply other threads:[~2023-08-31 14:55 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-31 14:52 [igt-dev] [PATCH i-g-t v4 00/11] Make test_list.py more generic Mauro Carvalho Chehab
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 01/11] scripts/test_list.py: make the class " Mauro Carvalho Chehab
2023-08-31 14:52 ` Mauro Carvalho Chehab [this message]
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 03/11] scripts/test_list.py: document what BAT stands for Mauro Carvalho Chehab
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 04/11] scripts/test_list.py: close config file before start processing Mauro Carvalho Chehab
2023-08-31 17:13 ` Kamil Konieczny
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 05/11] scripts/test_list.py: filename arguments for print_ methods are optional Mauro Carvalho Chehab
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 06/11] scripts/test_list.py: add a check before deleting properties Mauro Carvalho Chehab
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 07/11] scripts/test_list.py: skip some internal fields Mauro Carvalho Chehab
2023-08-31 17:16 ` Kamil Konieczny
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 08/11] scripts/test_list.py: add support to return a string instead of print Mauro Carvalho Chehab
2023-08-31 17:17 ` Kamil Konieczny
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 09/11] scripts/test_list.py: don't rely on file name to parse config Mauro Carvalho Chehab
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 10/11] scripts/test_list.py: allow passing a config dict directly Mauro Carvalho Chehab
2023-08-31 14:52 ` [igt-dev] [PATCH i-g-t v4 11/11] scripts/igt_doc.py: use field names when create a TestList instance Mauro Carvalho Chehab
2023-08-31 19:35 ` [igt-dev] ✗ GitLab.Pipeline: warning for Make test_list.py more generic Patchwork
2023-08-31 20:02 ` [igt-dev] ✓ CI.xeBAT: success " Patchwork
2023-08-31 20:12 ` [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=20230831145509.477543-3-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