public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-cpp/doctest/, dev-cpp/doctest/files/
@ 2023-04-26  4:03 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2023-04-26  4:03 UTC (permalink / raw
  To: gentoo-commits

commit:     b88bedd14cd548acfdbabb96a4300522db9f2109
Author:     Matoro Mahri <matoro <AT> users <DOT> noreply <DOT> github <DOT> com>
AuthorDate: Sat Apr 15 19:33:59 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Apr 26 04:02:59 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b88bedd1

dev-cpp/doctest: add patch for tests with clock resolution problems

See: https://github.com/doctest/doctest/pull/770
See: https://github.com/doctest/doctest/issues/711
Bug: https://bugs.gentoo.org/874345
Signed-off-by: Matoro Mahri <matoro <AT> users.noreply.github.com>
Closes: https://github.com/gentoo/gentoo/pull/30607
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-cpp/doctest/doctest-2.4.11.ebuild              |  1 +
 .../files/doctest-2.4.11-backport-pr770.patch      | 72 ++++++++++++++++++++++
 2 files changed, 73 insertions(+)

diff --git a/dev-cpp/doctest/doctest-2.4.11.ebuild b/dev-cpp/doctest/doctest-2.4.11.ebuild
index fa399178375b..c3a3b788415c 100644
--- a/dev-cpp/doctest/doctest-2.4.11.ebuild
+++ b/dev-cpp/doctest/doctest-2.4.11.ebuild
@@ -14,6 +14,7 @@ SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
 IUSE="test"
 RESTRICT="!test? ( test )"
+PATCHES=( "${FILESDIR}/${PN}-2.4.11-backport-pr770.patch" )
 
 src_prepare() {
 	sed -i '/-Werror/d' scripts/cmake/common.cmake || die

diff --git a/dev-cpp/doctest/files/doctest-2.4.11-backport-pr770.patch b/dev-cpp/doctest/files/doctest-2.4.11-backport-pr770.patch
new file mode 100644
index 000000000000..eb1f8625d34e
--- /dev/null
+++ b/dev-cpp/doctest/files/doctest-2.4.11-backport-pr770.patch
@@ -0,0 +1,72 @@
+https://bugs.gentoo.org/874345
+https://github.com/doctest/doctest/pull/770
+https://github.com/doctest/doctest/issues/711
+
+commit 1ffb66bff7533f7ea42d801facf1b87d72621ac5
+Author: matoro <matoro@users.noreply.github.com>
+Date:   Sat Apr 15 11:15:25 2023 -0400
+
+    Add sleep of one clock-resolution to test which should trigger timeout
+    
+    Fixes https://github.com/doctest/doctest/issues/711 under HPPA, and
+    partially under alpha.
+
+diff --git a/examples/all_features/CMakeLists.txt b/examples/all_features/CMakeLists.txt
+index ebc75c2..4556227 100644
+--- a/examples/all_features/CMakeLists.txt
++++ b/examples/all_features/CMakeLists.txt
+@@ -39,6 +39,12 @@ set(files_all
+ # add the executable
+ add_executable(all_features ${files_all})
+ target_link_libraries(all_features doctest ${CMAKE_THREAD_LIBS_INIT})
++if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
++    target_link_options(all_features PRIVATE "-rtlib=compiler-rt")
++    if(LINUX)
++        target_link_libraries(all_features "-lgcc_s")
++    endif()
++endif()
+ 
+ # easy way to fix test coverage - disable colors and crash handling
+ target_compile_definitions(all_features PRIVATE
+@@ -124,6 +130,12 @@ function(add_test_all_features test_name flags)
+     add_executable(${test_name} ${files_with_output})
+     target_compile_definitions(${test_name} PRIVATE ${flags})
+     target_link_libraries(${test_name} doctest ${CMAKE_THREAD_LIBS_INIT})
++    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
++        target_link_options(${test_name} PRIVATE "-rtlib=compiler-rt")
++        if(LINUX)
++            target_link_libraries(${test_name} "-lgcc_s")
++        endif()
++    endif()
+ 
+     doctest_add_test_impl(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}> --no-skipped-summary --no-version -ob=name)
+ endfunction()
+diff --git a/examples/all_features/test_cases_and_suites.cpp b/examples/all_features/test_cases_and_suites.cpp
+index 13b316d..d87f2fd 100644
+--- a/examples/all_features/test_cases_and_suites.cpp
++++ b/examples/all_features/test_cases_and_suites.cpp
+@@ -2,6 +2,12 @@
+ 
+ #include "header.h"
+ 
++DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN
++#include <chrono>
++#include <ctime>
++#include <thread>
++DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_END
++
+ static int doStuff() {
+     int a = 5;
+     a += 2;
+@@ -46,6 +52,11 @@ TEST_CASE_FIXTURE(SomeFixture, "fixtured test - not part of a test suite") {
+ 
+ TEST_CASE("normal test in a test suite from a decorator" * doctest::test_suite("ts1") *
+           doctest::timeout(0.000001)) {
++#ifndef _WIN32
++    struct timespec res{};
++    clock_getres(CLOCK_MONOTONIC, &res);
++    std::this_thread::sleep_for(std::chrono::nanoseconds(res.tv_nsec));
++#endif
+     MESSAGE("failing because of the timeout decorator!");
+ }
+ 


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-cpp/doctest/, dev-cpp/doctest/files/
@ 2025-10-18  9:03 Petr Vaněk
  0 siblings, 0 replies; 2+ messages in thread
From: Petr Vaněk @ 2025-10-18  9:03 UTC (permalink / raw
  To: gentoo-commits

commit:     53ffab1a8167a97a63f997c3dad6995b95e8779d
Author:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 18 09:01:26 2025 +0000
Commit:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
CommitDate: Sat Oct 18 09:01:26 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53ffab1a

dev-cpp/doctest: drop 2.4.11

Signed-off-by: Petr Vaněk <arkamar <AT> gentoo.org>

 dev-cpp/doctest/Manifest                           |  1 -
 dev-cpp/doctest/doctest-2.4.11.ebuild              | 33 ----------------------
 .../files/doctest-2.4.11-cmake4-pr888.patch        | 31 --------------------
 3 files changed, 65 deletions(-)

diff --git a/dev-cpp/doctest/Manifest b/dev-cpp/doctest/Manifest
index b37ba2fde46d..2f6f8ae4c38e 100644
--- a/dev-cpp/doctest/Manifest
+++ b/dev-cpp/doctest/Manifest
@@ -1,2 +1 @@
-DIST doctest-2.4.11.tar.gz 2183312 BLAKE2B 277f22f3a9e275dd9f5cfffeeaf8346577223c2b872606f21fe5b8462573917a59a88bb61de145a92be61129396f9b4a87d94f4723e362428b1bd856ed84fcfb SHA512 04425686057079d3f1a6f767c487f1953050f553dbff9fc42b42dde1358fe26e46bf6219881bbfce625f15cb9c229474d82688120eb2cb2b1d8138db0cc91b3c
 DIST doctest-2.4.12.tar.gz 2188849 BLAKE2B 94f2eb2988a175f52b1e75f4d84cfdce278ed647825d5a845284622efa9a9a921f958d0cf21e9215e0afebdcfa3ae82f87cc8b5d78f2ec7a3ef07b07457e81f7 SHA512 d55aae632e6d66add7b65d0e97bde5063cdae7512836f278613af35957c62dbc6b0b0febbe2eb1eddd334a7a5343faca7357a2eeebbf1428cafffeb5d18e610c

diff --git a/dev-cpp/doctest/doctest-2.4.11.ebuild b/dev-cpp/doctest/doctest-2.4.11.ebuild
deleted file mode 100644
index 5963e074ee84..000000000000
--- a/dev-cpp/doctest/doctest-2.4.11.ebuild
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 2022-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit cmake
-
-DESCRIPTION="The fastest feature-rich C++11/14/17/20 single-header testing framework"
-HOMEPAGE="https://github.com/doctest/doctest"
-SRC_URI="https://github.com/doctest/doctest/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="MIT"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
-IUSE="test"
-RESTRICT="!test? ( test )"
-
-PATCHES=(
-	"${FILESDIR}/${PN}-2.4.11-backport-pr770.patch"
-	"${FILESDIR}/${PN}-2.4.11-cmake4-pr888.patch"
-)
-
-src_prepare() {
-	sed -i '/-Werror/d' scripts/cmake/common.cmake || die
-	cmake_src_prepare
-}
-
-src_configure() {
-	local mycmakeargs=(
-		-DDOCTEST_WITH_TESTS=$(usex test)
-	)
-	cmake_src_configure
-}

diff --git a/dev-cpp/doctest/files/doctest-2.4.11-cmake4-pr888.patch b/dev-cpp/doctest/files/doctest-2.4.11-cmake4-pr888.patch
deleted file mode 100644
index 22aa020c9926..000000000000
--- a/dev-cpp/doctest/files/doctest-2.4.11-cmake4-pr888.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 82689538db96e478b5cb9f7753acf4121383df63 Mon Sep 17 00:00:00 2001
-From: "Trzcinski, Karol" <karol.trzcinski@intel.com>
-Date: Mon, 27 Jan 2025 08:53:06 +0100
-Subject: [PATCH] Bump minimal cmake version to 3.5
-
-Since cmake 3.27 appears warning like:
-
-```text
- Compatibility with CMake < 3.5 will be removed from a future version of
-  CMake.
-```
-
-Such information may found in cmake release notes:
-https://cmake.org/cmake/help/latest/release/3.27.html
-
-Gentoo-bug: https://bugs.gentoo.org/951674
-Upstream-PR: https://github.com/doctest/doctest/pull/888
----
- CMakeLists.txt | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 6d384fa96..0f6166b84 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -1,4 +1,4 @@
--cmake_minimum_required(VERSION 3.0)
-+cmake_minimum_required(VERSION 3.5)
- 
- if(POLICY CMP0077)
-     cmake_policy(SET CMP0077 NEW)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-18  9:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-26  4:03 [gentoo-commits] repo/gentoo:master commit in: dev-cpp/doctest/, dev-cpp/doctest/files/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2025-10-18  9:03 Petr Vaněk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox