Skip to content

Commit

Permalink
Disable tests if nihtest is too old.
Browse files Browse the repository at this point in the history
  • Loading branch information
dillof committed Dec 27, 2023
1 parent 58ce401 commit 3558ddd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 3558ddd

Please sign in to comment.