test_index.py 359 B

123456789101112131415
  1. from clang.cindex import *
  2. import os
  3. kInputsDir = os.path.join(os.path.dirname(__file__), 'INPUTS')
  4. def test_create():
  5. index = Index.create()
  6. # FIXME: test Index.read
  7. def test_parse():
  8. index = Index.create()
  9. assert isinstance(index, Index)
  10. tu = index.parse(os.path.join(kInputsDir, 'hello.cpp'))
  11. assert isinstance(tu, TranslationUnit)