add cmake option to disable the python tests

due to bugs in the openmpi on bionic, this test fails to
execute properly in pbuilder environments. instead
of rebuilding openmpi without dynamic loading
(which is the suggested fix) and potentially break users
systems, this is a non-intrusive workaround to be used
for packaging.

also add explicit option for python support to make it
visible in cmake frontends.
This commit is contained in:
Arne Morten Kvarving
2020-11-18 09:42:39 +01:00
parent 7b58071b8e
commit 16d644032c
2 changed files with 9 additions and 5 deletions

View File

@@ -27,6 +27,8 @@ option(BUILD_EBOS "Build the research oriented ebos simulator?" ON)
option(BUILD_EBOS_EXTENSIONS "Build the variants for various extensions of ebos by default?" OFF) option(BUILD_EBOS_EXTENSIONS "Build the variants for various extensions of ebos by default?" OFF)
option(BUILD_EBOS_DEBUG_EXTENSIONS "Build the ebos variants which are purely for debugging by default?" OFF) option(BUILD_EBOS_DEBUG_EXTENSIONS "Build the ebos variants which are purely for debugging by default?" OFF)
option(BUILD_FLOW_POLY_GRID "Build flow blackoil with polyhedral grid" OFF) option(BUILD_FLOW_POLY_GRID "Build flow blackoil with polyhedral grid" OFF)
option(OPM_ENABLE_PYTHON "Enable python bindings?" OFF)
option(OPM_ENABLE_PYTHON_TESTS "Enable tests for the python bindings?" ON)
if(SIBLING_SEARCH AND NOT opm-common_DIR) if(SIBLING_SEARCH AND NOT opm-common_DIR)
# guess the sibling dir # guess the sibling dir

View File

@@ -25,8 +25,10 @@ file( COPY ${PROJECT_SOURCE_DIR}/python/test
file( COPY ${PROJECT_SOURCE_DIR}/python/test_data file( COPY ${PROJECT_SOURCE_DIR}/python/test_data
DESTINATION ${PROJECT_BINARY_DIR}/python) DESTINATION ${PROJECT_BINARY_DIR}/python)
add_test(NAME python_tests if(OPM_ENABLE_PYTHON_TESTS)
add_test(NAME python_tests
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/python
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
-E env PYTHONPATH=${PROJECT_BINARY_DIR}/python:$ENV{PYTHONPATH} -E env PYTHONPATH=${PROJECT_BINARY_DIR}/python:$ENV{PYTHONPATH}
${PYTHON_EXECUTABLE} -m unittest ) ${PYTHON_EXECUTABLE} -m unittest )
endif()