[NFC][Coroutines] Use structured binding with llvm::enumerate in CoroSplit (#116879)
[llvm-project.git] / clang / bindings / python / tests / cindex / test_index.py
blob756f4bd9c7dfb5a7f3a760db5428edae5a5beb71
1 import os
3 from clang.cindex import Config, Index, TranslationUnit
5 if "CLANG_LIBRARY_PATH" in os.environ:
6 Config.set_library_path(os.environ["CLANG_LIBRARY_PATH"])
8 import unittest
10 kInputsDir = os.path.join(os.path.dirname(__file__), "INPUTS")
13 class TestIndex(unittest.TestCase):
14 def test_create(self):
15 Index.create()
17 # FIXME: test Index.read
19 def test_parse(self):
20 index = Index.create()
21 self.assertIsInstance(index, Index)
22 tu = index.parse(os.path.join(kInputsDir, "hello.cpp"))
23 self.assertIsInstance(tu, TranslationUnit)
24 tu = index.parse(None, ["-c", os.path.join(kInputsDir, "hello.cpp")])
25 self.assertIsInstance(tu, TranslationUnit)