Rewrite the tests from using plain 'assert' mixed with some nosetests methods to the standard unittest module layout. Improve the code to use the most canonical assertion methods whenever possible. This has a few major advantages: - the code uses standard methods now, resulting in a reduced number of WTFs whenever someone with basic Python knowledge gets to read it, - completely unnecessary dependency on nosetests is removed since the standard library supplies all that is necessary for the tests to run, - the tests can be run via any test runner, including the one built-in in Python, - the failure output for most of the tests is improved from 'assertion x == y failed' to actually telling the values. Differential Revision: https://reviews.llvm.org/D39763 llvm-svn: 317897
19 lines
603 B
Plaintext
19 lines
603 B
Plaintext
//===----------------------------------------------------------------------===//
|
|
// Clang Python Bindings
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
This directory implements Python bindings for Clang.
|
|
|
|
You may need to alter LD_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) \
|
|
python -m unittest discover -v
|
|
tests.cindex.test_index.test_create ... ok
|
|
...
|
|
|
|
OK
|
|
--
|