xref: /llvm-project-15.0.7/clang/bindings/python/tests/cindex/test_index.py (revision d5c558ff)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1from clang.cindex import *
2import os
3import unittest
4
5
6kInputsDir = os.path.join(os.path.dirname(__file__), 'INPUTS')
7
8
9class TestIndex(unittest.TestCase):
10    def test_create(self):
11        index = Index.create()
12
13    # FIXME: test Index.read
14
15    def test_parse(self):
16        index = Index.create()
17        self.assertIsInstance(index, Index)
18        tu = index.parse(os.path.join(kInputsDir, 'hello.cpp'))
19        self.assertIsInstance(tu, TranslationUnit)
20        tu = index.parse(None, ['-c', os.path.join(kInputsDir, 'hello.cpp')])
21        self.assertIsInstance(tu, TranslationUnit)
22

served by {OpenGrok

Last Index Update: Fri May 15 20:09:11 GMT 2026