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"


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to