ctest: control max warnings/errors on command line
Problem Motivation
I fail to understand if and how one can set CTEST options when not using a settings file. To be more specific, the default limits on CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS
and CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS
have quite low defaults (50) nowadays. But I fail to understand how to increase them.
What I tried so far
I added -DCTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS=1024
to the ctest call:
ctest --verbose \
--no-compress-output \
-DCTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS="1024" \
-DCUSTOM_MAXIMUM_NUMBER_OF_ERRORS="1024" \
-DCTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS="1024" \
-DCUSTOM_MAXIMUM_NUMBER_OF_WARNINGS="1024" \
--test-model Experimental \
--test-action Start \
--test-action Configure \
--test-action Build || exit 1
I also tried to pass them as cmake cache variables from CMakeLists.txt:
set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS "1024" CACHE STRING "Maximum number of errors to display")
set(CUSTOM_MAXIMUM_NUMBER_OF_ERRORS "1024" CACHE STRING "Maximum number of errors to display")
set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS "1024" CACHE STRING "Maximum number of warnings to display")
set(CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS "1024" CACHE STRING "Maximum number of warnings to display")
I also looked through the ctest source code but could not find any other related means to change these variables.