about summary refs log tree commit diff stats
path: root/create_report.py
blob: b3c0e70719fb404a69f6a0141dc7d1bf7c281a22 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from parse_data import parse_data
from jinja2 import Environment, FileSystemLoader
import argparse

parser = argparse.ArgumentParser(prog='test_report_manager')
parser.add_argument('executable', help="executable to parse")
parser.add_argument('-o', '--out', help="output file (default: report.html)", default="report.html")
args = parser.parse_args()

data, stats = parse_data(args.executable)

# Load the template from the current directory
env = Environment(loader=FileSystemLoader('.'))
template = env.get_template("template.html")

# Render the template with data
html_output = template.render(data=data, stats=stats)

# Save the generated HTML to a file
with open(args.out, "w", encoding="utf-8") as f:
    f.write(html_output)

print(f"Report generated: {args.out}")