mirror of
https://github.com/HendrikRauh/dmx-interface.git
synced 2026-04-09 03:11:29 +00:00
feat(doxygen): add option to generate Doxygen documentation before coverage check
This commit is contained in:
parent
ec045f8610
commit
94628b8523
3 changed files with 28 additions and 2 deletions
|
|
@ -42,6 +42,7 @@ __copyright__ = "Copyright (C) 2014 Alvaro Lopez Ortega"
|
|||
|
||||
from filecmp import cmp
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import argparse
|
||||
import xml.etree.ElementTree as ET
|
||||
|
|
@ -62,6 +63,20 @@ def FATAL(*objs):
|
|||
sys.exit(0 if ns.no_error else 1)
|
||||
|
||||
|
||||
def generate_docs():
|
||||
print("Generating Doxygen documentation...")
|
||||
proc = subprocess.run(
|
||||
"doxygen Doxyfile",
|
||||
shell=True,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
)
|
||||
if proc.returncode == 0:
|
||||
print("Documentation generated")
|
||||
else:
|
||||
FATAL("Failed to generate documentation. Exiting.")
|
||||
|
||||
|
||||
def parse_file(fullpath):
|
||||
tree = ET.parse(fullpath)
|
||||
|
||||
|
|
@ -200,12 +215,20 @@ def main():
|
|||
default=ACCEPTABLE_COVERAGE,
|
||||
type=int,
|
||||
)
|
||||
parser.add_argument(
|
||||
"--generate-docs",
|
||||
action="store_true",
|
||||
help="Generate Doxygen documentation before checking coverage",
|
||||
)
|
||||
|
||||
global ns
|
||||
ns = parser.parse_args()
|
||||
if not ns:
|
||||
FATAL("ERROR: Couldn't parse parameters")
|
||||
|
||||
if ns.generate_docs:
|
||||
generate_docs()
|
||||
|
||||
# Parse
|
||||
files = parse(ns.dir)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue