From f7d8d1d965b6a079b3f62e0783be2d08a3321a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 20 Dec 2017 11:04:18 +0200 Subject: [PATCH] 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). --- maxscale-system-test/utilities.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/maxscale-system-test/utilities.cmake b/maxscale-system-test/utilities.cmake index e7be837da..7bcbb7452 100644 --- a/maxscale-system-test/utilities.cmake +++ b/maxscale-system-test/utilities.cmake @@ -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()