Index: cfe/trunk/bindings/python/README.txt =================================================================== --- cfe/trunk/bindings/python/README.txt +++ cfe/trunk/bindings/python/README.txt @@ -4,12 +4,12 @@ This directory implements Python bindings for Clang. -You may need to alter LD_LIBRARY_PATH so that the Clang library can be +You may need to set CLANG_LIBRARY_PATH so that the Clang library can be found. The unit tests are designed to be run with any standard test runner. For example: -- $ env PYTHONPATH=$(echo ~/llvm/tools/clang/bindings/python/) \ - LD_LIBRARY_PATH=$(llvm-config --libdir) \ + CLANG_LIBRARY_PATH=$(llvm-config --libdir) \ python -m unittest discover -v tests.cindex.test_index.test_create ... ok ... Index: cfe/trunk/bindings/python/tests/cindex/test_access_specifiers.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_access_specifiers.py +++ cfe/trunk/bindings/python/tests/cindex/test_access_specifiers.py @@ -1,3 +1,7 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) from clang.cindex import AccessSpecifier from clang.cindex import Cursor Index: cfe/trunk/bindings/python/tests/cindex/test_cdb.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_cdb.py +++ cfe/trunk/bindings/python/tests/cindex/test_cdb.py @@ -1,3 +1,8 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) + from clang.cindex import CompilationDatabase from clang.cindex import CompilationDatabaseError from clang.cindex import CompileCommands Index: cfe/trunk/bindings/python/tests/cindex/test_code_completion.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_code_completion.py +++ cfe/trunk/bindings/python/tests/cindex/test_code_completion.py @@ -1,3 +1,8 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) + from clang.cindex import TranslationUnit import unittest Index: cfe/trunk/bindings/python/tests/cindex/test_comment.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_comment.py +++ cfe/trunk/bindings/python/tests/cindex/test_comment.py @@ -1,3 +1,8 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) + from clang.cindex import TranslationUnit from tests.cindex.util import get_cursor Index: cfe/trunk/bindings/python/tests/cindex/test_cursor.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_cursor.py +++ cfe/trunk/bindings/python/tests/cindex/test_cursor.py @@ -1,3 +1,8 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) + import ctypes import gc import unittest Index: cfe/trunk/bindings/python/tests/cindex/test_cursor_kind.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_cursor_kind.py +++ cfe/trunk/bindings/python/tests/cindex/test_cursor_kind.py @@ -1,3 +1,8 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) + from clang.cindex import CursorKind import unittest Index: cfe/trunk/bindings/python/tests/cindex/test_diagnostics.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_diagnostics.py +++ cfe/trunk/bindings/python/tests/cindex/test_diagnostics.py @@ -1,3 +1,8 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) + from clang.cindex import * from .util import get_tu Index: cfe/trunk/bindings/python/tests/cindex/test_exception_specification_kind.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_exception_specification_kind.py +++ cfe/trunk/bindings/python/tests/cindex/test_exception_specification_kind.py @@ -1,3 +1,8 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) + import clang.cindex from clang.cindex import ExceptionSpecificationKind from .util import get_tu Index: cfe/trunk/bindings/python/tests/cindex/test_file.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_file.py +++ cfe/trunk/bindings/python/tests/cindex/test_file.py @@ -1,3 +1,8 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) + from clang.cindex import Index, File import unittest Index: cfe/trunk/bindings/python/tests/cindex/test_index.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_index.py +++ cfe/trunk/bindings/python/tests/cindex/test_index.py @@ -1,3 +1,8 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) + from clang.cindex import * import os import unittest Index: cfe/trunk/bindings/python/tests/cindex/test_linkage.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_linkage.py +++ cfe/trunk/bindings/python/tests/cindex/test_linkage.py @@ -1,3 +1,8 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) + from clang.cindex import LinkageKind from clang.cindex import Cursor from clang.cindex import TranslationUnit Index: cfe/trunk/bindings/python/tests/cindex/test_location.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_location.py +++ cfe/trunk/bindings/python/tests/cindex/test_location.py @@ -1,3 +1,8 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) + from clang.cindex import Cursor from clang.cindex import File from clang.cindex import SourceLocation Index: cfe/trunk/bindings/python/tests/cindex/test_tls_kind.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_tls_kind.py +++ cfe/trunk/bindings/python/tests/cindex/test_tls_kind.py @@ -1,3 +1,8 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) + from clang.cindex import TLSKind from clang.cindex import Cursor from clang.cindex import TranslationUnit Index: cfe/trunk/bindings/python/tests/cindex/test_token_kind.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_token_kind.py +++ cfe/trunk/bindings/python/tests/cindex/test_token_kind.py @@ -1,3 +1,8 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) + from clang.cindex import TokenKind import unittest Index: cfe/trunk/bindings/python/tests/cindex/test_tokens.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_tokens.py +++ cfe/trunk/bindings/python/tests/cindex/test_tokens.py @@ -1,3 +1,8 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) + from clang.cindex import CursorKind from clang.cindex import Index from clang.cindex import SourceLocation Index: cfe/trunk/bindings/python/tests/cindex/test_translation_unit.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_translation_unit.py +++ cfe/trunk/bindings/python/tests/cindex/test_translation_unit.py @@ -1,3 +1,8 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) + from contextlib import contextmanager import gc import os Index: cfe/trunk/bindings/python/tests/cindex/test_type.py =================================================================== --- cfe/trunk/bindings/python/tests/cindex/test_type.py +++ cfe/trunk/bindings/python/tests/cindex/test_type.py @@ -1,3 +1,8 @@ +import os +from clang.cindex import Config +if 'CLANG_LIBRARY_PATH' in os.environ: + Config.set_library_path(os.environ['CLANG_LIBRARY_PATH']) + import gc import unittest