Added compatibility for Catch < 2, hopefully.
the build failed Details

This commit is contained in:
tastytea 2019-01-01 17:35:14 +01:00
parent 0e3d1e4691
commit b0c0e0ef09
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
6 changed files with 15 additions and 7 deletions

View File

@ -43,7 +43,9 @@ pipeline:
- rm -rf build && mkdir -p build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DWITH_TESTS=1 ..
- make VERBOSE=1
- ctest ..
- ./test_ltr_symmetric
- ./test_ltr_asymmetric
- ./test_sigil
- make install DESTDIR=install
- make package
- cmake -DWITH_DEB=ON ..

View File

@ -1,2 +1,2 @@
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
#include <catch.hpp>

View File

@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch.hpp>
#include <string>
#include <Magick++/Image.h>
#include "identiconpp.hpp"

View File

@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch.hpp>
#include <string>
#include <Magick++/Image.h>
#include "identiconpp.hpp"

View File

@ -1,4 +1,4 @@
#include <catch2/catch.hpp>
#include <catch.hpp>
#include <string>
#include <Magick++/Image.h>
#include "identiconpp.hpp"

View File

@ -1,12 +1,18 @@
if(WITH_TESTS)
find_package(Catch2 REQUIRED)
find_package(Catch2)
if(Catch2_FOUND)
set(MYCATCH, Catch2::Catch2)
else()
set(MYCATCH, "")
endif()
include(CTest)
file(GLOB sources_tests src/tests/test_*.cpp)
foreach(src ${sources_tests})
get_filename_component(bin ${src} NAME_WE)
add_executable(${bin} src/tests/main.cpp ${src})
target_link_libraries(${bin} ${CMAKE_PROJECT_NAME} Catch2::Catch2)
target_link_libraries(${bin} ${CMAKE_PROJECT_NAME} ${MYCATCH})
target_include_directories(${bin} PRIVATE "/usr/include/catch2")
add_test(${bin} ${bin})
endforeach()
endif()