Skip to content

Commit 8852b66

Browse files
committed
cmake: add a test so that we catch broken Python modules early
It is incompatible with sanitizers at the moment.
1 parent b031eed commit 8852b66

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@ macro(build_pycsdiff version boost_python_lib_names)
157157

158158
install(TARGETS pycsdiff_py${version}
159159
DESTINATION ${Python${version}_SITEARCH})
160+
161+
# TODO: support running pycsdiff with sanitizers
162+
if(NOT SANITIZERS)
163+
# assert that the library is usable
164+
add_test(NAME "pycsdiff_py${version}"
165+
COMMAND ${Python${version}_EXECUTABLE} -c "import pycsdiff"
166+
WORKING_DIRECTORY $<TARGET_FILE_DIR:pycsdiff_py${version}>)
167+
endif()
160168
endmacro()
161169

162170
if(PYCSDIFF_PYTHON2)

0 commit comments

Comments
 (0)