Added compatibility for Catch < 2, hopefully.
the build failed
Details
the build failed
Details
This commit is contained in:
parent
0e3d1e4691
commit
b0c0e0ef09
|
@ -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 ..
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#define CATCH_CONFIG_MAIN
|
||||
#include <catch2/catch.hpp>
|
||||
#include <catch.hpp>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <catch2/catch.hpp>
|
||||
#include <catch.hpp>
|
||||
#include <string>
|
||||
#include <Magick++/Image.h>
|
||||
#include "identiconpp.hpp"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <catch2/catch.hpp>
|
||||
#include <catch.hpp>
|
||||
#include <string>
|
||||
#include <Magick++/Image.h>
|
||||
#include "identiconpp.hpp"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include <catch2/catch.hpp>
|
||||
#include <catch.hpp>
|
||||
#include <string>
|
||||
#include <Magick++/Image.h>
|
||||
#include "identiconpp.hpp"
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue