Skip to content
Snippets Groups Projects
Commit 6a96d3ad authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

scripts/test_list.py: allow adding multiple testlist lines with same name


Sometimes, multiple files may contain testlists and blocklists for
the same name.

Add support for it by placing such lists on an array, and storing one
testlist dictionary per line.

Reviewed-by: default avatarKamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 7ed6190b
No related branches found
No related tags found
No related merge requests found
......@@ -333,16 +333,18 @@ class TestList:
# Read testlist files if any
if "testlists" in item["_properties_"]:
testlist = {}
for name in item["_properties_"]["testlists"].keys():
self.read_testlist(testlist, name, cfg_path + item["_properties_"]["testlists"][name])
for value in item["_properties_"]["testlists"]:
for name in value.keys():
self.read_testlist(testlist, name, cfg_path + value[name])
item["_properties_"]["testlist"] = testlist
# Read blocklist files if any
if "blocklists" in item["_properties_"]:
blocklist = {}
for name in item["_properties_"]["blocklists"].keys():
self.read_testlist(blocklist, name, cfg_path + item["_properties_"]["blocklists"][name])
for value in item["_properties_"]["blocklists"]:
for name in value.keys():
self.read_testlist(testlist, name, cfg_path + value[name])
item["_properties_"]["blocklist"] = blocklist
......@@ -450,7 +452,8 @@ class TestList:
base = r"^\s*({}[^\s\{}]+)(\S*)\s*(\#.*)?$"
regex = re.compile(base.format(self.main_name, self.subtest_separator))
testlist[name] = []
if name not in testlist:
testlist[name] = []
with open(filename, 'r', newline = '', encoding = 'utf8') as fp:
for line in fp:
match = regex.match(line)
......
......@@ -23,18 +23,18 @@
"_properties_": {
"description": "Defines what category of testlist it belongs",
"default-testlist": "FULL",
"testlists": {
"i915 BAT": "../intel-ci/fast-feedback.testlist",
"i915 BAT chamelium": "../intel-ci/fast-feedback-chamelium-only.testlist",
"i915 chamelium": "../intel-ci/chamelium-only.testlist",
"testlists": [
{ "i915 BAT": "../intel-ci/fast-feedback.testlist" },
{ "i915 BAT chamelium": "../intel-ci/fast-feedback-chamelium-only.testlist" },
{ "i915 chamelium": "../intel-ci/chamelium-only.testlist" },
"Xe BAT": "../intel-ci/xe-fast-feedback.testlist",
"Xe BAT chamelium": "../intel-ci/xe-fast-feedback-chamelium-only.testlist"
},
"blocklists": {
"i915 BAT, i915 BAT chamelium, i915 chamelium": "../intel-ci/blacklist.txt",
"Xe BAT, Xe BAT chamelium": "../intel-ci/xe.blocklist.txt"
}
{ "Xe BAT": "../intel-ci/xe-fast-feedback.testlist" },
{ "Xe BAT chamelium": "../intel-ci/xe-fast-feedback-chamelium-only.testlist" }
],
"blocklists": [
{ "i915 BAT, i915 BAT chamelium, i915 chamelium": "../intel-ci/blacklist.txt" },
{ "Xe BAT, Xe BAT chamelium": "../intel-ci/xe.blocklist.txt" }
]
}
}
},
......
......@@ -33,12 +33,12 @@
"mandatory": true,
"description": "Defines what category of testlist it belongs",
"default-testlist": "FULL",
"testlists": {
"Xe BAT": "../intel-ci/xe-fast-feedback.testlist"
},
"blocklists": {
"Xe BAT": "../intel-ci/xe.blocklist.txt"
},
"testlists": [
{ "Xe BAT": "../intel-ci/xe-fast-feedback.testlist" }
],
"blocklists": [
{ "Xe BAT": "../intel-ci/xe.blocklist.txt" }
],
"order": [
"boot",
"__all__",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment