[libgit2-glib] [coverage] Trace declaration references



commit 89e912ee65baa74d85846426ee2448dad9757174
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Tue Jun 24 16:23:48 2014 +0200

    [coverage] Trace declaration references

 tools/coverage.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/tools/coverage.py b/tools/coverage.py
index f4397b0..01d8243 100755
--- a/tools/coverage.py
+++ b/tools/coverage.py
@@ -114,9 +114,14 @@ def scan_libgit2_glib(cflags, files, git2dir):
             calls = {}
 
             for cursor in walk_cursors(tu, files):
-                if cursor.kind == cindex.CursorKind.CALL_EXPR:
+                if cursor.kind == cindex.CursorKind.CALL_EXPR or \
+                   cursor.kind == cindex.CursorKind.DECL_REF_EXPR:
+
                     cdecl = cursor.get_referenced()
 
+                    if cdecl.kind != cindex.CursorKind.FUNCTION_DECL:
+                        continue
+
                     if (not cdecl is None) and (not cdecl.location.file is None):
                         fdefname = cdecl.location.file.name.decode('utf-8')
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]