Commit 0d33c9c6 authored by Millian Poquet's avatar Millian Poquet

[test] add a doxygen-warnings test

parent ea253820
......@@ -216,6 +216,7 @@ set(BSALGO_submitter "submitter!submitter")
##############################################
# Delegate generation of tests to subscripts #
##############################################
add_subdirectory(doxygen-warnings)
add_subdirectory(nosched)
add_subdirectory(simple)
add_subdirectory(energy)
......
# Create the test
add_test(NAME doxygen-warnings
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/check_no_warnings.py
${CMAKE_SOURCE_DIR}/doc
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
#!/usr/bin/env python3
"""Run doxygen on batsim code, and check that there is no warning."""
import subprocess
import sys
# The path from where doxygen should be executed
doxygen_path = sys.argv[1]
# Run doxygen
proc = subprocess.run("doxygen", cwd=doxygen_path, stdout=subprocess.PIPE)
if proc.returncode != 0:
print('doxygen did not return 0. Aborting.')
sys.exit(1)
# Read doxygen logs
logs = open('{p}/doxygen_warnings.log'.format(p=doxygen_path)).read()
if len(logs) == 0:
print('No doxygen warnings! :)')
sys.exit(0)
else:
print("{}\nThere are doxygen warnings :(. Aborting.".format(logs))
sys.exit(1)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment