]> granicus.if.org Git - clang/commitdiff
[python] Add testcase for annotation cursor
authorAnders Waldenborg <anders@0x63.nu>
Wed, 2 May 2012 21:28:34 +0000 (21:28 +0000)
committerAnders Waldenborg <anders@0x63.nu>
Wed, 2 May 2012 21:28:34 +0000 (21:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156022 91177308-0d34-0410-b5e6-96231b3b80d8

bindings/python/tests/cindex/test_cursor.py

index c88aec19a86cb6e20358f3cacee526f51d6a1abd..0582d2af63f0ee3fe2ed640a1a34d7f5e3e2d18c 100644 (file)
@@ -135,3 +135,15 @@ def test_enum_values_cpp():
     assert ham.kind == CursorKind.ENUM_CONSTANT_DECL
     assert ham.enum_value == 0x10000000000
 
+def test_annotation_attribute():
+    tu = get_tu('int foo (void) __attribute__ ((annotate("here be annotation attribute")));')
+
+    foo = get_cursor(tu, 'foo')
+    assert foo is not None
+
+    for c in foo.get_children():
+        if c.kind == CursorKind.ANNOTATE_ATTR:
+            assert c.displayname == "here be annotation attribute"
+            break
+    else:
+        assert False, "Couldn't find annotation"