summaryrefslogtreecommitdiffstats
path: root/clang/bindings/python/tests/cindex/test_cursor.py
Commit message (Collapse)AuthorAgeFilesLines
* [python] [tests] Support overriding library path via environmentMichal Gorny2018-10-111-0/+5
| | | | | | | | | | | | | | | | | Support a new CLANG_LIBRARY_PATH environment variable for the Python binding tests. This variable can be used to force the bindings to load libclang.* from a specific directory. I plan to use this when integrating Python binding tests with the CMake build system. Currently, those tests load libclang.so from default search paths, so I would have to rely on platform-specific mechanics such as LD_LIBRARY_PATH. Instead of copying the whole logic necessary to handle platform differences into yet another place, it's easier to just add a dedicated variable for this purpose. Differential Revision: https://reviews.llvm.org/D52806 llvm-svn: 344240
* [bindings] Fix most Python binding unittests on WindowsJonathan Coe2018-06-211-2/+2
| | | | | | | | | | | | | | | | | | Summary: This fixes all but one of the test cases for Windows. TestCDB will take more work to debug, as CompilationDatabase seems not to work correctly. Reviewers: bkramer, wanders, jbcoe Reviewed By: bkramer, jbcoe Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47864 Patch written by ethanhs (Ethan) llvm-svn: 335282
* [python bindings] Fix Cursor.result_type for ObjC method declarations - Bug ↵Jonathan Coe2018-04-221-0/+12
| | | | | | | | | | | | | | | | | | | | | 36677 Summary: In cindex.py, Cursor.result_type called into the wrong libclang function, causing cursors for ObjC method declarations to return invalid result types. Fixes Bug 36677. Reviewers: jbcoe, rsmith Reviewed By: jbcoe Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D45671 Patch by kjteske (Kyle Teske). llvm-svn: 330557
* Remove duplicate python libclang changes from r320748Alex Lorenz2017-12-141-11/+0
| | | | llvm-svn: 320766
* [libclang] Add support for checking abstractness of recordsAlex Lorenz2017-12-141-0/+22
| | | | | | | | | | | This patch allows checking whether a C++ record declaration is abstract through libclang and clang.cindex (Python). Patch by Johann Klähn! Differential Revision: https://reviews.llvm.org/D36952 llvm-svn: 320748
* [python] [tests] Rewrite to use standard unittest moduleMichal Gorny2017-11-101-477/+481
| | | | | | | | | | | | | | | | | | | | | | | | | Rewrite the tests from using plain 'assert' mixed with some nosetests methods to the standard unittest module layout. Improve the code to use the most canonical assertion methods whenever possible. This has a few major advantages: - the code uses standard methods now, resulting in a reduced number of WTFs whenever someone with basic Python knowledge gets to read it, - completely unnecessary dependency on nosetests is removed since the standard library supplies all that is necessary for the tests to run, - the tests can be run via any test runner, including the one built-in in Python, - the failure output for most of the tests is improved from 'assertion x == y failed' to actually telling the values. Differential Revision: https://reviews.llvm.org/D39763 llvm-svn: 317897
* [libclang] Add support for querying cursor availabilityJonathan Coe2017-10-161-0/+25
| | | | | | | | | | | | | | | | | | | | Summary: This patch allows checking the availability of cursors through libclang and clang.cindex (Python). This e.g. allows to check whether a C++ member function has been marked as deleted. Reviewers: arphaman, jbcoe Reviewed By: jbcoe Subscribers: cfe-commits Tags: #clang Patch by jklaehn (Johann Klähn) Differential Revision: https://reviews.llvm.org/D36973 llvm-svn: 315959
* [libclang] Visit attributes for function and class templatesJonathan Coe2017-10-161-0/+20
| | | | | | | | | | | | | | | | | | Summary: Previously, `VisitAttributes` was not called for function and class templates and thus their attributes were not accessible using libclang. Reviewers: bkramer, arphaman, rsmith, jbcoe Reviewed By: jbcoe Subscribers: cfe-commits Tags: #clang Patch by jklaehn (Johann Klähn) Differential Revision: https://reviews.llvm.org/D36955 llvm-svn: 315958
* [libclang] Keep track of TranslationUnit instance when annotating tokensJonathan Coe2017-09-211-0/+22
| | | | | | | | | | | | | | | | | | | | Summary: Previously the `_tu` was not propagated to the returned cursor, leading to errors when calling any method on that cursor (e.g. `cursor.referenced`). Reviewers: jbcoe, rsmith Reviewed By: jbcoe Subscribers: cfe-commits Tags: #clang Patch by jklaehn (Johann Klähn) Differential Revision: https://reviews.llvm.org/D36953 llvm-svn: 313913
* [libclang] Support for querying whether an enum is scopedAlex Lorenz2017-07-121-0/+16
| | | | | | | | | | | This commit allows checking whether an enum declaration is scoped through libclang and clang.cindex (Python). Patch by Johann Klähn! Differential Revision: https://reviews.llvm.org/D35187 llvm-svn: 307771
* Revert r307769 (Forgot to mention the name of the contributor).Alex Lorenz2017-07-121-16/+0
| | | | llvm-svn: 307770
* [libclang] Support for querying whether an enum is scopedAlex Lorenz2017-07-121-0/+16
| | | | | | | | | This commit allows checking whether an enum declaration is scoped through libclang and clang.cindex (Python). Differential Revision: https://reviews.llvm.org/D35187 llvm-svn: 307769
* [libclang] Fix python testsSergey Kalinichev2016-12-031-1/+1
| | | | | | It was broken in r286421 llvm-svn: 288582
* Expose cxx constructor and method properties through libclang and python ↵Jonathan Coe2016-04-271-0/+82
| | | | | | | | | | | | | | | | | | | | | | | bindings. Summary: I have exposed the following function through libclang and the clang.cindex python bindings: clang_CXXConstructor_isConvertingConstructor, clang_CXXConstructor_isCopyConstructor, clang_CXXConstructor_isDefaultConstructor, clang_CXXConstructor_isMoveConstructor, clang_CXXMethod_isDefaulted I need (some of) these methods for a C++ code model I am building in Python to drive a code generator. Reviewers: compnerd, skalinichev Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15469 llvm-svn: 267706
* Index: expose is_mutable_fieldSaleem Abdulrasool2015-10-271-0/+15
| | | | | | | | Expose isMutable via libClang and python bindings. Patch by Jonathan B Coe! llvm-svn: 251410
* bindings: add new C++ function attribute accessorsSaleem Abdulrasool2015-10-121-0/+45
| | | | | | | | | Add methods to index Cursor to see if a cxx method is pure_virtual, virtual or const methods. Patch by Jonathan B Coe! llvm-svn: 250008
* Add libclang capabilities to retriete template arguments from specializations.Eli Bendersky2014-10-101-0/+44
| | | | | | | | | Includes Python bindings. Reviewed in http://reviews.llvm.org/D5621 Patch by Rob Springer llvm-svn: 219529
* Expose the name mangling C API to Python bindings.Eli Bendersky2014-08-051-0/+14
| | | | llvm-svn: 214930
* cindex/test_cursor.py: no need to skip implicit decls in testsAlp Toker2014-05-211-8/+1
| | | | | | | | | clang was fixed some time ago to always skip "builtins and other cruft" so tools no longer need hacks like this. Passes nosetests. llvm-svn: 209316
* [python bindings] Expose cursor.referenced (clang_getCursorReferenced).Argyrios Kyrtzidis2013-01-021-0/+9
| | | | | | Patch by Matthew King! llvm-svn: 171423
* [clang.py] Add Cursor.get_arguments()Gregory Szorc2012-11-011-0/+9
| | | | | | Patch provided by Matthias Kleine <matthias_kleine@gmx.de> llvm-svn: 167216
* [clang.py] Implement Token APIGregory Szorc2012-07-121-0/+10
| | | | llvm-svn: 160111
* [clang.py] Implement Cursor.is_static_methodGregory Szorc2012-06-091-0/+16
| | | | llvm-svn: 158277
* [clang.py] Store reference to TranslationUnit in Cursor and TypeGregory Szorc2012-05-151-0/+23
| | | | llvm-svn: 156846
* [clang.py] Implement Cursor.canonicalGregory Szorc2012-05-141-0/+12
| | | | llvm-svn: 156753
* [clang.py] Implement Cursor.result_typeGregory Szorc2012-05-141-0/+8
| | | | llvm-svn: 156752
* [clang.py] Remove trailing whitespace from recent commitsGregory Szorc2012-05-081-3/+3
| | | | llvm-svn: 156373
* - Adding lexical_parent and semantic_parent properties to clang.cindex.CursorManuel Klimek2012-05-071-0/+25
| | | | | | | | | - Two new tests (one for each property), require libclang built from r155858 or later to pass - New test utility function (get_cursors) that gets all the nodes with a specific spelling. Patch by Evan Pipho. llvm-svn: 156286
* [python] Add testcase for annotation cursorAnders Waldenborg2012-05-021-0/+12
| | | | llvm-svn: 156022
* [python] Add Cursor.enum_value wrapping clang_getEnumConstantDeclValueAnders Waldenborg2012-05-021-0/+37
| | | | llvm-svn: 156017
* [python] Add testcase for enum with specified underlaying typeAnders Waldenborg2012-05-021-0/+8
| | | | llvm-svn: 156009
* [clang.py] Implement Cursor.objc_type_encodingGregory Szorc2012-03-101-0/+7
| | | | llvm-svn: 152513
* [clang.py] Refactor get_tu and get_cursor test helper functions into util.pyGregory Szorc2012-03-101-22/+12
| | | | llvm-svn: 152510
* [clang.py] Test Cursor.__ne__Gregory Szorc2012-02-261-0/+1
| | | | llvm-svn: 151504
* [clang.py] Implement Cursor.enum_typeTobias Grosser2012-02-051-0/+15
| | | | | | Contributed by: Gregory Szorc <gregory.szorc@gmail.com> llvm-svn: 149830
* [clang.py] Implement Cursor.underlying_typedef_typeTobias Grosser2012-02-051-0/+15
| | | | | | Contributed by: Gregory Szorc <gregory.szorc@gmail.com> llvm-svn: 149829
* [clang.py] Implement Cursor.hashTobias Grosser2012-02-051-0/+1
| | | | | | Contributed by: Gregory Szorc <gregory.szorc@gmail.com> llvm-svn: 149826
* Add support for Cursor.displayname in python bindings, from Anders Waldenborg!Douglas Gregor2011-08-301-0/+2
| | | | llvm-svn: 138785
* [python] Add support for CXType to python bindings.Argyrios Kyrtzidis2011-08-171-1/+3
| | | | | | Patch by Anders Waldenborg! llvm-svn: 137797
* cindex/Python: Update Index.create for removal of displayDiagnostics.Daniel Dunbar2010-01-301-1/+1
| | | | llvm-svn: 94931
* cindex/Python: Add Cursor test.Daniel Dunbar2010-01-251-0/+59
llvm-svn: 94397
OpenPOWER on IntegriCloud