compare-ast-clang-and-cppcheck: Write some statistics.

This commit is contained in:
Daniel Marjamäki 2018-04-30 10:24:01 +02:00
parent aff108a16f
commit 45a89b1c46
1 changed files with 10 additions and 4 deletions

View File

@ -71,9 +71,15 @@ ast2 = cppcheck_ast(sys.argv[1])
# print(func)
print('Compare...')
numberOfMissing = 0
numberOfExtra = 0
for func in ast1:
if func not in ast2:
print('- ' + func)
#for func in ast2:
# if func not in ast1:
# print('+ ' + func)
numberOfMissing = numberOfMissing + 1
print('Missing Function ' + func)
for func in ast2:
if func not in ast1:
numberOfExtra = numberOfExtra + 1
print('Extra Function ' + func)
print('Number of missing functions: ' + str(numberOfMissing))
print('Number of extra functions: ' + str(numberOfExtra) + ' (clang AST currently only contains FunctionDecl and CXXMethod)')