File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -190,6 +190,31 @@ If the `-DGRK_DATA_ROOT:PATH` option is omitted,
190190test files will be automatically searched for in
191191` ${CMAKE_SOURCE_DIR}/../grok-test-data `
192192
193+ ### Python Tests
194+
195+ Python tests are automatically enabled when ` BUILD_TESTING=ON ` and SWIG bindings are built
196+ (` GRK_BUILD_CORE_SWIG_BINDINGS=ON ` ). They require [ pytest] ( https://docs.pytest.org/ ) to be installed.
197+
198+ To run the Python tests via ` ctest ` :
199+
200+ $ cd /PATH/TO/BUILD
201+ $ ctest -R python_tests -V
202+
203+ To run them directly with ` pytest ` :
204+
205+ $ cd /PATH/TO/BUILD/bin
206+ $ PYTHONPATH=/PATH/TO/BUILD/bin python -m pytest /PATH/TO/SOURCE/tests/python -v --tb=short
207+
208+ To run a single test file:
209+
210+ $ cd /PATH/TO/BUILD/bin
211+ $ PYTHONPATH=/PATH/TO/BUILD/bin python -m pytest /PATH/TO/SOURCE/tests/python/test_roundtrip.py -v
212+
213+ Note: if the build has address sanitizer enabled (` -DWITH_SANITIZER=Address ` ),
214+ Python tests will fail because the ASAN runtime must be loaded before Python.
215+ Either rebuild without ASAN (` -DWITH_SANITIZER=OFF ` ) or preload the runtime:
216+
217+ $ LD_PRELOAD=$(gcc -print-file-name=libasan.so) PYTHONPATH=/PATH/TO/BUILD/bin python -m pytest ...
193218
194219## macOS
195220
You can’t perform that action at this time.
0 commit comments