From 45a89b1c46a90f8e1b38d333c9b2fb49a7619d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 30 Apr 2018 10:24:01 +0200 Subject: [PATCH] compare-ast-clang-and-cppcheck: Write some statistics. --- tools/compare-ast-clang-and-cppcheck.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/compare-ast-clang-and-cppcheck.py b/tools/compare-ast-clang-and-cppcheck.py index 9cc684fb7..36ebb9be2 100644 --- a/tools/compare-ast-clang-and-cppcheck.py +++ b/tools/compare-ast-clang-and-cppcheck.py @@ -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)')