]>
Commit | Line | Data |
---|---|---|
223e47cc LB |
1 | This directory contains Python bindings for LLVM's C library. |
2 | ||
3 | The bindings are currently a work in progress and are far from complete. | |
4 | Use at your own risk. | |
5 | ||
6 | Developer Info | |
7 | ============== | |
8 | ||
9 | The single Python package is "llvm." Modules inside this package roughly | |
10 | follow the names of the modules/headers defined by LLVM's C API. | |
11 | ||
12 | Testing | |
13 | ------- | |
14 | ||
15 | All test code is location in llvm/tests. Tests are written as classes | |
16 | which inherit from llvm.tests.base.TestBase, which is a convenience base | |
17 | class that provides common functionality. | |
18 | ||
19 | Tests can be executed by installing nose: | |
20 | ||
21 | pip install nosetests | |
22 | ||
23 | Then by running nosetests: | |
24 | ||
25 | nosetests | |
26 | ||
27 | To see more output: | |
28 | ||
29 | nosetests -v | |
30 | ||
31 | To step into the Python debugger while running a test, add the following | |
32 | to your test at the point you wish to enter the debugger: | |
33 | ||
34 | import pdb; pdb.set_trace() | |
35 | ||
36 | Then run nosetests: | |
37 | ||
38 | nosetests -s -v | |
39 | ||
40 | You should strive for high code coverage. To see current coverage: | |
41 | ||
42 | pip install coverage | |
43 | nosetests --with-coverage --cover-html | |
44 | ||
45 | Then open cover/index.html in your browser of choice to see the code coverage. | |
46 | ||
47 | Style Convention | |
48 | ---------------- | |
49 | ||
50 | All code should pass PyFlakes. First, install PyFlakes: | |
51 | ||
52 | pip install pyflakes | |
53 | ||
54 | Then at any time run it to see a report: | |
55 | ||
56 | pyflakes . | |
57 | ||
58 | Eventually we'll provide a Pylint config file. In the meantime, install | |
59 | Pylint: | |
60 | ||
61 | pip install pylint | |
62 | ||
63 | And run: | |
64 | ||
65 | pylint llvm | |
66 | ||
67 | And try to keep the number of violations to a minimum. |