[python] Add testcase for annotation cursor

llvm-svn: 156022
This commit is contained in:
Anders Waldenborg 2012-05-02 21:28:34 +00:00
parent 4e639f168c
commit 750c04f1a5
1 changed files with 12 additions and 0 deletions

View 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"