5
paRootDirectory = '../../'
6
paHtmlDocDirectory = os.path.join( paRootDirectory, "doc", "html" )
8
##this script assumes that html doxygen documentation has been generated
10
##it then walks the entire portaudio source tree and check that
11
##- every source file (.c,.h,.cpp) has a doxygen comment block containing
12
## - a @file directive
13
## - a @brief directive
14
## - a @ingroup directive
15
##- it also checks that a corresponding html documentation file has been generated.
17
##This can be used as a first-level check to make sure the documentation is in order.
19
##The idea is to get a list of which files are missing doxygen documentation.
22
# recurse from top and return a list of all with the given
23
# extensions. ignore .svn directories. return absolute paths
24
def recursiveFindFiles( top, extensions, includePaths ):
26
for (dirpath, dirnames, filenames) in os.walk(top):
27
if not '.svn' in dirpath:
29
if os.path.splitext(f)[1] in extensions:
31
result.append( os.path.abspath( os.path.join( dirpath, f ) ) )
36
# generate the html file name that doxygen would use for
37
# a particular source file. this is a brittle conversion
38
# which i worked out by trial and error
39
def doxygenHtmlDocFileName( sourceFile ):
40
return sourceFile.replace( '_', '__' ).replace( '.', '_8' ) + '.html'
43
sourceFiles = recursiveFindFiles( paRootDirectory, [ '.c', '.h', '.cpp' ], True );
44
docFiles = recursiveFindFiles( paHtmlDocDirectory, [ '.html' ], False );
50
def printError( f, message ):
59
if not doxygenHtmlDocFileName( os.path.basename(f) ) in docFiles:
60
printError( f, "no doxygen generated doc page" )
62
s = file( f, 'rt' ).read()
65
printError( f, "no doxygen /** block" )
68
printError( f, "no doxygen @file tag" )
71
printError( f, "no doxygen @brief tag" )
73
if not '@ingroup' in s:
74
printError( f, "no doxygen @ingroup tag" )