- chapter = suite_longname.split(u'.')[-1]
- file_name = f"{table_set}/{chapter}.rst"
- logging.info(f" Writing file {file_name}")
- with open(file_name, u"a") as file_handler:
- file_handler.write(rst_header)
- if chapters.get(chapter, None) is None:
- chapters[chapter] = OrderedDict()
- chapters[chapter][sub_chapter] = file_name
-
- title_line = get_rst_title_char(suite[u"level"] - start_lvl + 2) * \
- len(sub_chapter)
- with open(file_name, u"a") as file_handler:
- if not (u"-ndrpdr" in suite[u"name"] or
- u"-mrr" in suite[u"name"] or
- u"-dev" in suite[u"name"]):
- file_handler.write(f"\n{sub_chapter}\n{title_line}\n")
-
- if _tests_in_suite(suite[u"name"], tests):
- for tbl_file in table_lst:
- if suite[u"name"] in tbl_file:
- title_line = get_rst_title_char(
- suite[u"level"] - start_lvl + 2) * \
- len(suite[u"name"])
- file_handler.write(
- f"\n{suite[u'name']}\n{title_line}\n"
- )
- file_handler.write(
- f"\n{suite[u'doc']}\n".
- replace(u'|br|', u'\n\n -')
+ chapter_l1 = suite_longname.split(u'.')[-1]
+ if chapters.get(chapter_l1, None) is None:
+ chapters[chapter_l1] = OrderedDict()
+ if chapters[chapter_l1].get(chapter_l2, None) is None:
+ chapters[chapter_l1][chapter_l2] = OrderedDict()
+ continue
+
+ if _tests_in_suite(suite[u"name"], tests):
+ groups = re.search(REGEX_NIC_SHORT, suite[u"name"])
+ nic = groups.group(2) if groups else None
+ if nic is None:
+ continue
+ if chapters[chapter_l1][chapter_l2].get(nic, None) is None:
+ chapters[chapter_l1][chapter_l2][nic] = dict(
+ rst_file=f"{join(table_set, chapter_l1)}_{nic}.rst".
+ replace(u"2n1l-", u""),
+ tables=list()
+ )
+ for idx, tbl_file in enumerate(table_lst):
+ if suite[u"name"] in tbl_file:
+ chapters[chapter_l1][chapter_l2][nic][u"tables"].append(
+ (
+ table_lst.pop(idx),
+ suite[u"doc"].replace(u'|br|', u'\n\n -')