Skip to content

Commit 0b13280

Browse files
committed
Updates to make index.html easier to read
1 parent 368d32c commit 0b13280

File tree

3 files changed

+84
-24
lines changed

3 files changed

+84
-24
lines changed

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2025.07.07-1412-0400-g2ecf9f2
1+
v2025.08.15-1525-0400-g368d32c

create_index_html.py

Lines changed: 51 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,71 @@ def __enter__(self):
1616
def __exit__(self, etype, value, traceback):
1717
os.chdir(self.savedPath)
1818

19+
def searchKeyword(search_string, filename):
20+
with open(filename, "r") as f:
21+
for line_number, line in enumerate(f, start=1):
22+
if search_string in line:
23+
start_idx = line.find(search_string)
24+
if start_idx != -1:
25+
start_idx += len(search_string)
26+
27+
end_idx = line[start_idx:].find("<")
28+
29+
if end_idx != -1:
30+
end_idx += start_idx
31+
32+
return line_number, start_idx, end_idx, line
33+
34+
return -1, -1, -1, line # not found
35+
36+
def getEnvName(search_string, filename):
37+
report_name = None
38+
line_number, start_idx, end_idx, line = searchKeyword("<tr><th>Environment Name</th><td>",filename)
39+
40+
if line_number == -1:
41+
env_name = None
42+
else:
43+
env_name = line[start_idx:end_idx]
44+
45+
return env_name
46+
1947
def getReportName(filename):
2048

2149
reportName = filename
2250
reportType = 0
2351

24-
if "aggregate" in filename:
25-
manageProject = filename.split("_aggregate",1)[0]
26-
reportName = "Aggregate Coverage Report"
52+
if searchKeyword(">Aggregate Coverage Report<", filename)[0] != -1:
53+
env_name = getEnvName("<tr><th>Environment Name</th><td>",filename)
54+
if env_name == None:
55+
reportName = "Aggregate Coverage Report"
56+
else:
57+
reportName = f"Aggregate Coverage Report {env_name}"
58+
reportType = 1
2759

28-
elif "full_status" in filename:
29-
manageProject = filename.split("_aggregate",1)[0]
60+
elif searchKeyword(">Full Status Section<", filename)[0] != -1:
3061
reportName = "Full Status Report"
3162

32-
elif "environment" in filename:
33-
manageProject = filename.split("_environment",1)[0]
34-
reportName = "Environment Report"
35-
36-
elif "manage_incremental_rebuild_report" in filename:
37-
manageProject = filename.split("_manage_incremental_rebuild_report",1)[0]
63+
elif searchKeyword("Manage Incremental Rebuild Report", filename)[0] != -1:
3864
reportName = "Incremental Report Report"
3965

40-
elif "metrics" in filename:
41-
manageProject = filename.split("_metrics",1)[0]
66+
elif searchKeyword(">Metrics Report<", filename)[0] != -1:
4267
reportName = "Metrics Report"
4368

44-
elif "html_reports" in filename:
45-
## html_reports/VectorCAST_MinGW_C++_UnitTesting_ENV_LINKED_LIST.html
46-
comp_ts_env = filename.replace("html_reports/","").replace(".html","")
47-
reportName = comp_ts_env
69+
elif searchKeyword(">Test Case Summary Report<", filename)[0] != -1:
70+
reportName = "System Test Status Report"
71+
72+
elif searchKeyword(">PC-Lint Plus Results<", filename)[0] != -1:
73+
reportName = "PC-Lint Plus Results"
74+
75+
elif searchKeyword(">PC-Lint Plus Results<", filename)[0] != -1:
76+
reportName = "PC-Lint Plus Results"
77+
78+
elif searchKeyword(">Full Report<", filename)[0] != -1:
79+
reportName = "Full Report "
80+
reportName += getEnvName("<tr><th>Environment Name</th><td>",filename)
81+
4882
reportType = 1
4983

50-
elif "management" in filename:
51-
comp_ts_env = filename.replace("management/","").replace(".html","")
52-
reportName = comp_ts_env
53-
reportType = 3
54-
5584
else:
5685
reportType = 2
5786

vcast_exec.py

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,32 @@ def generateTestCaseMgtRpt(self):
393393
else:
394394
print("Cannot create Test Case Management HTML report. Please upgrade VectorCAST")
395395

396+
397+
def generateUtFullReport(self):
398+
if not os.path.exists(os.path.join(self.output_dir, "management")):
399+
os.makedirs(os.path.join(self.output_dir, "management"))
400+
else:
401+
for file in glob.glob(os.path.join(self.output_dir, "management","*_full_report.html")):
402+
os.remove(file)
403+
404+
if checkVectorCASTVersion(21):
405+
print("Creating Unit Test Case Full Report")
406+
from vector.apps.DataAPI.vcproject_api import VCProjectApi
407+
408+
with VCProjectApi(self.FullMP) as vcprojApi:
409+
for env in vcprojApi.Environment.all():
410+
if not env.is_active:
411+
continue
412+
413+
self.needIndexHtml = True
414+
415+
report_name = env.compiler.name + "_" + env.testsuite.name + "_" + env.name + "_full_report.html"
416+
report_name = os.path.join(self.output_dir, "management",report_name)
417+
print(f"Creating Full Report HTML report for {env.name} in {report_name}")
418+
env.api.report(report_type="FULL_REPORT", formats=["HTML"], output_file=report_name)
419+
else:
420+
print("Cannot create Test Case Management HTML report. Please upgrade VectorCAST")
421+
396422

397423
def exportRgw(self):
398424
print("Creating RGW Exports")
@@ -479,7 +505,9 @@ def runExec(self):
479505
reportGroup.add_argument('--aggregate', help='Generate aggregate coverage report VectorCAST Project', action="store_true", default = False)
480506
reportGroup.add_argument('--metrics', help='Generate metrics reports for VectorCAST Project', action="store_true", default = False)
481507
reportGroup.add_argument('--fullstatus', help='Generate full status reports for VectorCAST Project', action="store_true", default = False)
508+
reportGroup.add_argument('--utfull', help='Generate Full Reports for each VectorCAST environment in project', action="store_true", default = False)
482509
reportGroup.add_argument('--tcmr', help='Generate Test Cases Management Reports for each VectorCAST environment in project', action="store_true", default = False)
510+
reportGroup.add_argument('--index', help='Generate an index.html report that ties all the other HTML reports together', action="store_true", default = False)
483511

484512
beGroup = parser.add_argument_group('Build/Execution Options', 'Options that effect build/execute operation')
485513

@@ -550,7 +578,10 @@ def runExec(self):
550578
if args.tcmr:
551579
vcExec.generateTestCaseMgtRpt()
552580

553-
if vcExec.needIndexHtml:
581+
if args.utfull:
582+
vcExec.generateUtFullReport()
583+
584+
if vcExec.needIndexHtml or args.index:
554585
vcExec.generateIndexHtml()
555586

556587
if args.export_rgw:

0 commit comments

Comments
 (0)