From 3558dddf55c76ad408b38464707aef8f3abfed9a Mon Sep 17 00:00:00 2001 From: Dieter Baron Date: Wed, 27 Dec 2023 21:27:46 +0100 Subject: [PATCH] Disable tests if nihtest is too old. --- CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c2a16a..d621cb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,10 +51,19 @@ ENDIF(NOT TARGET dist) ADD_DEFINITIONS("-DHAVE_CONFIG_H") find_program(NIHTEST nihtest) +set(NIHTEST_REQUIRED_VERSION "1.4") + if(RUN_REGRESS) - if (NOT NIHTEST) + if(NOT NIHTEST) message(WARNING "-- nihtest not found, regression testing disabled") set(RUN_REGRESS OFF) + else() + execute_process(COMMAND ${NIHTEST} --version OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE NIHTEST_VERSION_RAW) + string(REGEX REPLACE "[^ ]* " "" NIHTEST_VERSION ${NIHTEST_VERSION_RAW}) + if (${NIHTEST_VERSION} VERSION_LESS ${NIHTEST_REQUIRED_VERSION}) + message(WARNING "-- nihtest ${NIHTEST_VERSION} too old, at least ${NIHTEST_REQUIRED_VERSION} required, regression testing disabled") + set(RUN_REGRESS OFF) + endif() endif() endif()