#! /usr/bin/env python3
# -*- coding: utf-8 -*-
-# Copyright (c) 2019-2020. The SimGrid Team. All rights reserved.
+# Copyright (c) 2019-2022. The SimGrid Team. All rights reserved.
# This program is free software; you can redistribute it and/or modify it
# under the terms of the license (GNU LGPL) which comes with this package.
"""
Search for symbols documented in both the XML files produced by Doxygen and the python modules,
-but not documented with autodoxy in the RST files.
+but not documented with breathe in the RST files.
-This script is tailored to SimGrid own needs and should be made more generic for autodoxy.
+This script is tailored to SimGrid own needs.
If you are missing some dependencies, try: pip3 install --requirement docs/requirements.txt
"""
'build/xml/classsimgrid_1_1s4u_1_1ConditionVariable.xml',
'build/xml/classsimgrid_1_1s4u_1_1Disk.xml',
'build/xml/classsimgrid_1_1s4u_1_1Engine.xml',
- 'build/xml/classsimgrid_1_1s4u_1_1ExecPar.xml',
- 'build/xml/classsimgrid_1_1s4u_1_1ExecSeq.xml',
'build/xml/classsimgrid_1_1s4u_1_1Exec.xml',
'build/xml/classsimgrid_1_1s4u_1_1Host.xml',
'build/xml/classsimgrid_1_1s4u_1_1Io.xml',
'build/xml/classsimgrid_1_1s4u_1_1NetZone.xml',
'build/xml/classsimgrid_1_1s4u_1_1Semaphore.xml',
'build/xml/classsimgrid_1_1s4u_1_1VirtualMachine.xml',
+ 'build/xml/classsimgrid_1_1xbt_1_1signal_3_01R_07P_8_8_8_08_4.xml',
+ 'build/xml/namespacesimgrid_1_1s4u_1_1this__actor.xml',
'build/xml/actor_8h.xml',
'build/xml/barrier_8h.xml',
'build/xml/cond_8h.xml',
doxy_funs = {} # {classname: {func_name: [args]} }
doxy_vars = {} # {classname: [names]}
+doxy_type = {} # {classname: [names]}
# find the declarations in the XML files
for arg in xml_files:
#print ("compoundname {}".format(compoundname))
elif elem.attrib["kind"] == "file":
compoundname = ""
+ elif elem.attrib["kind"] == "namespace":
+ compoundname = elem.find("compoundname").text
else:
print("Element {} is of kind {}".format(elem.attrib["id"], elem.attrib["kind"]))
if name not in doxy_funs[compoundname]:
doxy_funs[compoundname][name] = []
doxy_funs[compoundname][name].append(args)
+ elif kind == "typedef":
+ if compoundname not in doxy_type:
+ doxy_type[compoundname] = []
+ doxy_type[compoundname].append(name)
elif kind == "friend":
pass # Ignore friendship
else:
print ("member {}::{} is of kind {}".format(compoundname, name, kind))
# Forget about the declarations that are done in the RST
-with os.popen('grep autodoxymethod:: find-missing.ignore source/*rst|sed \'s/^.*autodoxymethod:: //\'') as pse:
+with os.popen('grep doxygenfunction:: find-missing.ignore source/*rst|sed \'s/^.*doxygenfunction:: //\'|sed \'s/ *const//\'') as pse:
for line in (l.strip() for l in pse):
(klass, obj, args) = (None, None, None)
if "(" in line:
doxy_funs[klass][obj].remove(args)
if len(doxy_funs[klass][obj]) == 0:
del doxy_funs[klass][obj]
-with os.popen('grep autodoxyvar:: find-missing.ignore source/*rst|sed \'s/^.*autodoxyvar:: //\'') as pse:
+with os.popen('grep doxygenvariable:: find-missing.ignore source/*rst|sed \'s/^.*doxygenvariable:: //\'') as pse:
for line in (l.strip() for l in pse):
(klass, var) = line.rsplit('::', 1)
print("Warning: {} documented, but class {} not found in doxygen.".format(line, klass))
continue
if var not in doxy_vars[klass]:
- print("Warning: Object {} documented but not found in {}".format(line, klass))
+ print("Warning: Object {} documented but not found in '{}'".format(line, klass))
else:
# print("Found {} in {}".format(line, klass))
doxy_vars[klass].remove(var)
if len(doxy_vars[klass]) == 0:
del doxy_vars[klass]
+with os.popen('grep doxygentypedef:: find-missing.ignore source/*rst|sed \'s/^.*doxygentypedef:: //\'') as pse:
+ for line in (l.strip() for l in pse):
+ if '::' in line:
+ (klass, typ) = line.rsplit('::', 1)
+ else:
+ (klass, typ) = ('', line)
+
+ if klass not in doxy_type:
+ print("Warning: {} documented, but class {} not found in doxygen.".format(line, klass))
+ continue
+ if typ not in doxy_type[klass]:
+ print("Warning: Type {} documented but not found in '{}'".format(line, klass))
+ else:
+# print("Found {} in {}".format(line, klass))
+ doxy_type[klass].remove(typ)
+ if len(doxy_type[klass]) == 0:
+ del doxy_type[klass]
-# Dump the undocumented Doxygen declarations
+# Dump the undocumented Doxygen declarations
for obj in sorted(doxy_funs):
for meth in sorted(doxy_funs[obj]):
for args in sorted(doxy_funs[obj][meth]):
- print(".. autodoxymethod:: {}::{}{}".format(obj, meth, args))
+ if obj == '':
+ print(".. doxygenfunction:: {}{}".format(meth, args))
+ else:
+ print(".. doxygenfunction:: {}::{}{}".format(obj, meth, args))
for obj in doxy_vars:
for meth in sorted(doxy_vars[obj]):
- print(".. autodoxyvar:: {}::{}".format(obj, meth))
+ print(".. doxygenvariable:: {}::{}".format(obj, meth))
+
+for obj in doxy_type:
+ for meth in sorted(doxy_type[obj]):
+ if obj == '':
+ print(".. doxygentypedef:: {}".format(meth))
+ else:
+ print(".. doxygentypedef:: {}::{}".format(obj, meth))