mirror of
https://github.com/HendrikRauh/dmx-interface.git
synced 2026-04-07 10:22:21 +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
|
|
@ -11,7 +11,8 @@ exclude: |
|
|||
.*\.o|
|
||||
flake.lock|
|
||||
dependencies.lock|
|
||||
assets/case/
|
||||
assets/case/|
|
||||
docs/doxygen/
|
||||
)
|
||||
|
||||
repos:
|
||||
|
|
@ -113,7 +114,8 @@ repos:
|
|||
name: doxygen code coverage
|
||||
language: system
|
||||
entry: tools/doxy-coverage.py
|
||||
args: [docs/doxygen/xml, --threshold=40, --summary-only]
|
||||
args:
|
||||
[docs/doxygen/xml, --threshold=40, --summary-only, --generate-docs]
|
||||
types_or: [c, c++, header]
|
||||
verbose: false
|
||||
require_serial: true
|
||||
|
|
|
|||
1
bootloader
Submodule
1
bootloader
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 0bf633be000a2b62796e071a18b93c1018d3e369
|
||||
|
|
@ -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