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
|
- rm -rf build && mkdir -p build && cd build
|
||||||
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DWITH_TESTS=1 ..
|
- cmake -DCMAKE_INSTALL_PREFIX=/usr -DWITH_TESTS=1 ..
|
||||||
- make VERBOSE=1
|
- make VERBOSE=1
|
||||||
- ctest ..
|
- ./test_ltr_symmetric
|
||||||
|
- ./test_ltr_asymmetric
|
||||||
|
- ./test_sigil
|
||||||
- make install DESTDIR=install
|
- make install DESTDIR=install
|
||||||
- make package
|
- make package
|
||||||
- cmake -DWITH_DEB=ON ..
|
- cmake -DWITH_DEB=ON ..
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#define CATCH_CONFIG_MAIN
|
#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 <string>
|
||||||
#include <Magick++/Image.h>
|
#include <Magick++/Image.h>
|
||||||
#include "identiconpp.hpp"
|
#include "identiconpp.hpp"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include <catch2/catch.hpp>
|
#include <catch.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <Magick++/Image.h>
|
#include <Magick++/Image.h>
|
||||||
#include "identiconpp.hpp"
|
#include "identiconpp.hpp"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include <catch2/catch.hpp>
|
#include <catch.hpp>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <Magick++/Image.h>
|
#include <Magick++/Image.h>
|
||||||
#include "identiconpp.hpp"
|
#include "identiconpp.hpp"
|
||||||
|
|
|
@ -1,12 +1,18 @@
|
||||||
if(WITH_TESTS)
|
if(WITH_TESTS)
|
||||||
find_package(Catch2 REQUIRED)
|
find_package(Catch2)
|
||||||
|
if(Catch2_FOUND)
|
||||||
|
set(MYCATCH, Catch2::Catch2)
|
||||||
|
else()
|
||||||
|
set(MYCATCH, "")
|
||||||
|
endif()
|
||||||
include(CTest)
|
include(CTest)
|
||||||
|
|
||||||
file(GLOB sources_tests src/tests/test_*.cpp)
|
file(GLOB sources_tests src/tests/test_*.cpp)
|
||||||
foreach(src ${sources_tests})
|
foreach(src ${sources_tests})
|
||||||
get_filename_component(bin ${src} NAME_WE)
|
get_filename_component(bin ${src} NAME_WE)
|
||||||
add_executable(${bin} src/tests/main.cpp ${src})
|
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})
|
add_test(${bin} ${bin})
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue