[cfe-commits] r156022 - /cfe/trunk/bindings/python/tests/cindex/test_cursor.py

Anders Waldenborg anders at 0x63.nu
Wed May 2 14:28:34 PDT 2012


Author: andersg
Date: Wed May  2 16:28:34 2012
New Revision: 156022

URL: http://llvm.org/viewvc/llvm-project?rev=156022&view=rev
Log:
[python] Add testcase for annotation cursor

Modified:
    cfe/trunk/bindings/python/tests/cindex/test_cursor.py

Modified: cfe/trunk/bindings/python/tests/cindex/test_cursor.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/bindings/python/tests/cindex/test_cursor.py?rev=156022&r1=156021&r2=156022&view=diff
==============================================================================
--- cfe/trunk/bindings/python/tests/cindex/test_cursor.py (original)
+++ cfe/trunk/bindings/python/tests/cindex/test_cursor.py Wed May  2 16:28:34 2012
@@ -135,3 +135,15 @@
     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"





More information about the cfe-commits mailing list