Move to official catch cmake support, update catch

This is an effort to fix the issues on Appveyor with newer versions of
CMake. Will have to double check that it does not break Travis
This commit is contained in:
Jason Turner 2018-05-26 09:26:13 -06:00
parent f8bb8dc53e
commit 73f177c73e
3 changed files with 585 additions and 269 deletions

View File

@ -119,6 +119,7 @@ configure_file(Doxyfile.in ${CMAKE_BINARY_DIR}/Doxyfile)
include(CTest) include(CTest)
include(CPack) include(CPack)
include(CMake/Catch.cmake)
if(NOT MINGW) if(NOT MINGW)
find_library(READLINE_LIBRARY NAMES readline PATH /usr/lib /usr/local/lib /opt/local/lib) find_library(READLINE_LIBRARY NAMES readline PATH /usr/lib /usr/local/lib /opt/local/lib)
@ -428,7 +429,7 @@ if(BUILD_TESTING)
if(NOT UNIT_TEST_LIGHT) if(NOT UNIT_TEST_LIGHT)
add_executable(compiled_tests unittests/compiled_tests.cpp) add_executable(compiled_tests unittests/compiled_tests.cpp)
target_link_libraries(compiled_tests ${LIBS} ${CHAISCRIPT_LIBS}) target_link_libraries(compiled_tests ${LIBS} ${CHAISCRIPT_LIBS})
ADD_CATCH_TESTS(compiled_tests) catch_discover_tests(compiled_tests TEST_PREFIX "compiled.")
add_executable(static_chaiscript_test unittests/static_chaiscript.cpp) add_executable(static_chaiscript_test unittests/static_chaiscript.cpp)
target_link_libraries(static_chaiscript_test ${LIBS}) target_link_libraries(static_chaiscript_test ${LIBS})

View File

@ -50,14 +50,13 @@ string(REPLACE "\n" ";" output "${output}")
# Parse output # Parse output
foreach(line ${output}) foreach(line ${output})
# Test name; strip spaces to get just the name... set(test ${line})
string(REGEX REPLACE " +" "" test "${line}")
# ...and add to script # ...and add to script
add_command(add_test add_command(add_test
"${prefix}${test}${suffix}" "${prefix}${test}${suffix}"
${TEST_EXECUTOR} ${TEST_EXECUTOR}
"${TEST_EXECUTABLE}" "${TEST_EXECUTABLE}"
"${test}" ${test}
${extra_args} ${extra_args}
) )
add_command(set_tests_properties add_command(set_tests_properties

File diff suppressed because it is too large Load Diff