nuspell: fix for new catch2

This commit is contained in:
Đoàn Trần Công Danh 2023-10-01 23:07:08 +07:00 committed by Đoàn Trần Công Danh
parent dbbd780a36
commit a4170f2b12
2 changed files with 41 additions and 2 deletions

View File

@ -0,0 +1,40 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -58,7 +58,7 @@ endfunction()
if (BUILD_TESTING)
enable_testing()
- find_package(Catch2 2.3.0 QUIET)
+ find_package(Catch2 QUIET)
if (NOT Catch2_FOUND)
find_catch2_from_source()
endif()
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,5 +1,5 @@
add_executable(unit_test unit_test.cxx catch_main.cxx)
-target_link_libraries(unit_test PRIVATE nuspell Catch2::Catch2)
+target_link_libraries(unit_test PRIVATE nuspell Catch2::Catch2WithMain)
if (MSVC)
target_compile_options(unit_test PRIVATE "/utf-8")
# Consider doing this for all the other targets by setting this flag
--- a/tests/catch_main.cxx
+++ b/tests/catch_main.cxx
@@ -16,5 +16,4 @@
* along with Nuspell. If not, see <http://www.gnu.org/licenses/>.
*/
-#define CATCH_CONFIG_MAIN
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
--- a/tests/unit_test.cxx
+++ b/tests/unit_test.cxx
@@ -16,7 +16,7 @@
* along with Nuspell. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <catch2/catch.hpp>
+#include <catch2/catch_all.hpp>
#include <nuspell/dictionary.hxx>
#include <nuspell/utils.hxx>

View File

@ -4,8 +4,7 @@ version=5.1.2
revision=3
build_style=cmake
configure_args="-DBUILD_SHARED_LIBS=ON"
makedepends="icu-devel"
checkdepends="catch2"
makedepends="icu-devel catch2"
short_desc="C++ spell checking library"
maintainer="John <me@johnnynator.dev>"
license="LGPL-3.0-or-later"