summaryrefslogtreecommitdiffstats
path: root/bindings/python
diff options
context:
space:
mode:
authorAnders Waldenborg <anders@0x63.nu>2012-05-02 21:28:34 +0000
committerAnders Waldenborg <anders@0x63.nu>2012-05-02 21:28:34 +0000
commit228e5703a69dbbfdb481fee0e2e4edad8f92e5fe (patch)
tree2b22a454a08c352c7bba2e156a9828371202a4a4 /bindings/python
parentbbc2e090996cdf51f0e7a4235f6e0ca65c95d514 (diff)
[python] Add testcase for annotation cursor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156022 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/python')
-rw-r--r--bindings/python/tests/cindex/test_cursor.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/bindings/python/tests/cindex/test_cursor.py b/bindings/python/tests/cindex/test_cursor.py
index c88aec19a8..0582d2af63 100644
--- a/bindings/python/tests/cindex/test_cursor.py
+++ b/bindings/python/tests/cindex/test_cursor.py
@@ -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"