about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorChristian Krinitsin <christian.krinitsin@iqmine.de>2025-04-08 15:35:27 +0200
committerChristian Krinitsin <christian.krinitsin@iqmine.de>2025-04-08 15:35:27 +0200
commit79f32b351b1883cf47cb9bab53d5b07ba05d5791 (patch)
tree212054390004ef79b30f37f596dac40819788c40
parent07741cdf203e3a7e339ef0b65c43107ac83877f0 (diff)
downloadtestreport-79f32b351b1883cf47cb9bab53d5b07ba05d5791.tar.gz
testreport-79f32b351b1883cf47cb9bab53d5b07ba05d5791.zip
add output option
-rw-r--r--.gitignore3
-rw-r--r--create_report.py5
2 files changed, 5 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 58420ae..d50d3a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
-report.html
+*.html
+!template.html
 __pycache__
 *.exe
\ No newline at end of file
diff --git a/create_report.py b/create_report.py
index c70b094..b3c0e70 100644
--- a/create_report.py
+++ b/create_report.py
@@ -4,6 +4,7 @@ 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)
@@ -16,7 +17,7 @@ template = env.get_template("template.html")
 html_output = template.render(data=data, stats=stats)
 
 # Save the generated HTML to a file
-with open("report.html", "w", encoding="utf-8") as f:
+with open(args.out, "w", encoding="utf-8") as f:
     f.write(html_output)
 
-print("Report generated: report.html")
\ No newline at end of file
+print(f"Report generated: {args.out}")
\ No newline at end of file