diff --git a/devel/cpp-utilities/Makefile b/devel/cpp-utilities/Makefile index d4cfea6e818c..d631c136efa4 100644 --- a/devel/cpp-utilities/Makefile +++ b/devel/cpp-utilities/Makefile @@ -1,25 +1,26 @@ PORTNAME= cpp-utilities DISTVERSIONPREFIX= v DISTVERSION= 5.24.0 +PORTREVISION= 1 CATEGORIES= devel MAINTAINER= yuri@FreeBSD.org COMMENT= Common C++ classes such as argument parser, IO, conversion utilities WWW= https://github.com/Martchus/cpp-utilities LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/LICENSE LIB_DEPENDS= libboost_iostreams.so:devel/boost-libs +TEST_DEPENDS= cppunit>0:devel/cppunit USES= cmake:testing compiler:c++17-lang USE_LDCONFIG= yes USE_GITHUB= yes GH_ACCOUNT= Martchus CMAKE_ON= BUILD_SHARED_LIBS - -# unclear how to run tests, see https://github.com/Martchus/cpp-utilities/issues/26 +CMAKE_TESTING_ARGS= -DEXCLUDE_TESTS_FROM_ALL=OFF # tests fail to link: ld: error: unable to find library -lcppunit, see https://github.com/Martchus/cpp-utilities/issues/27 .include diff --git a/devel/cpp-utilities/files/patch-tests_testutils.cpp b/devel/cpp-utilities/files/patch-tests_testutils.cpp new file mode 100644 index 000000000000..f98330cb99ec --- /dev/null +++ b/devel/cpp-utilities/files/patch-tests_testutils.cpp @@ -0,0 +1,11 @@ +--- tests/testutils.cpp.orig 2023-07-05 03:40:48 UTC ++++ tests/testutils.cpp +@@ -621,7 +621,7 @@ std::vector TestApplication::readTestfile + auto binaryPath = std::string(); + #if defined(CPP_UTILITIES_USE_STANDARD_FILESYSTEM) && defined(PLATFORM_UNIX) + try { +- binaryPath = std::filesystem::read_symlink("/proc/self/exe").parent_path(); ++ binaryPath = std::filesystem::read_symlink("/proc/curproc/file").parent_path(); + binaryPath += '/'; + } catch (const std::filesystem::filesystem_error &e) { + cerr << Phrases::Warning << "Unable to detect binary path for finding \"srcdirref\": " << e.what() << Phrases::EndFlush;