| 1 |
You'll find in this folder: |
| 2 |
|
| 3 |
- ``*.py`` with various tests inside |
| 4 |
- ``svg`` with the source SVG files for non-regression tests |
| 5 |
- ``resources`` and ``images`` with various resources for the SVG files |
| 6 |
- ``fail`` with the failing tests |
| 7 |
|
| 8 |
If you want to check that CairoSVG works on your computer, you should not |
| 9 |
launch the tests here, you should instead launch tests in |
| 10 |
``cairosvg/test_api.py``:: |
| 11 |
|
| 12 |
pytest cairosvg/test_api.py |
| 13 |
|
| 14 |
The tests here are regression tests: they generate reference images using an |
| 15 |
old version on CairoSVG and compare them to the current version. They are based |
| 16 |
on the official SVG test suite available on the W3 website: |
| 17 |
|
| 18 |
http://www.w3.org/Graphics/SVG/WG/wiki/Test_Suite_Overview |
| 19 |
|
| 20 |
These tests are really useful if you changed the code. You can launch both |
| 21 |
these tests and the API tests by getting the submodule and launching |
| 22 |
``pytest`` in the root folder of the repository:: |
| 23 |
|
| 24 |
git submodule update --init |
| 25 |
pytest |
| 26 |
|
| 27 |
You can launch the tests only on one image (or more than one, separated by a |
| 28 |
comma) using:: |
| 29 |
|
| 30 |
env CAIROSVG_TEST_FILES=svg/image.svg pytest test_non_regression/test_non_regression.py |
| 31 |
|
| 32 |
As CairoSVG does not handle SVG fonts, you can install the corresponding OTF |
| 33 |
fonts in order to test CairoSVG with the right fonts. They have already been |
| 34 |
generated for you in the ``resources`` folder. |