================
@@ -0,0 +1,17 @@
+import os
+
+from clang.cindex import Config, conf, FUNCTION_LIST
+
+if "CLANG_LIBRARY_PATH" in os.environ:
+    Config.set_library_path(os.environ["CLANG_LIBRARY_PATH"])
+
+import unittest
+
+
+class TestIndex(unittest.TestCase):
+    def test_functions_registered(self):
+        IGNORED = set(["_FuncPtr", "_name", "_handle"])
+        lib_functions = set(vars(conf.lib).keys())
----------------
DeinAlptraum wrote:

Aah that explains a lot... that's the reason why `clang_getCursorTLSKind` 
wasn't found, because all the other missing functions are used in tests before 
`test_lib`, but `clang_getCursorTLSKind` comes after. It's also the reason why 
we don't have exposed but unused (on Python side) functions popping up.

Problem is, we don't actually want all functions in the lib, but only those 
actually used in the Python bindings... so I only see two options here:
1. do some kind of static code analysis to check all functions that are used in 
cindex.py. A bit roundabout, but should work...
2. test as I did before, but ensure somehow that the lib test comes last. A bit 
ugly as it depends on the order of tests, and this requires that we have tests 
for any missing functions.

https://github.com/llvm/llvm-project/pull/140015
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to