Add test environment dependency checks

The test environment is now checked to contain all executables needed for
testing before tests are built. They can be overridden by defining the
relevant HAVE_X variables (currently only HAVE_MYSQLTEST and HAVE_PHP are
defined).
This commit is contained in:
Markus Mäkelä
2017-12-20 11:04:18 +02:00
parent b54dca50b5
commit f7d8d1d965

View File

@ -113,3 +113,19 @@ ExternalProject_Add(cdc_connector
set(CDC_CONNECTOR_INCLUDE ${CMAKE_BINARY_DIR}/cdc_connector/include/ CACHE INTERNAL "")
set(CDC_CONNECTOR_LIBRARIES ${CMAKE_BINARY_DIR}/cdc_connector/lib/libcdc_connector.so CACHE INTERNAL "")
include_directories(${CMAKE_BINARY_DIR}/cdc_connector/include)
#
# Check that all required components are present. To build even without them,
# add e.g. -DHAVE_PHP=Y to the CMake invocation
#
find_program(HAVE_MYSQLTEST mysqltest)
if (NOT HAVE_MYSQLTEST)
message(FATAL_ERROR "Could not find mysqltest.")
endif()
find_program(HAVE_PHP php)
if (NOT HAVE_PHP)
message(FATAL_ERROR "Could not find php.")
endif()