From 04edf1e532aae8c5be0d0d4d0e184cf5504846ca Mon Sep 17 00:00:00 2001
From: ado <adnan.abd0124@gmail.com>
Date: Sun, 12 Feb 2023 12:23:25 +0100
Subject: [PATCH] Make project used forked doctest

---
 script/ci_install_deps.sh |  2 +-
 subprojects/doctest.wrap  |  4 ++--
 test/CMakeLists.txt       | 20 +++++++++++---------
 3 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/script/ci_install_deps.sh b/script/ci_install_deps.sh
index 0b8a4c5..6ed958e 100755
--- a/script/ci_install_deps.sh
+++ b/script/ci_install_deps.sh
@@ -5,7 +5,7 @@ BUILD_TYPE=Debug
 
 set -eux
 
-git clone https://github.com/onqtam/doctest -b 2.4.4 --depth 1
+git clone https://github.com/red0124/doctest -b master --depth 1
 
 cmake -S doctest -B doctest/build \
     -D CMAKE_BUILD_TYPE=${BUILD_TYPE} \
diff --git a/subprojects/doctest.wrap b/subprojects/doctest.wrap
index 09a7134..fee6d7d 100644
--- a/subprojects/doctest.wrap
+++ b/subprojects/doctest.wrap
@@ -1,3 +1,3 @@
 [wrap-git]
-url = https://github.com/onqtam/doctest
-revision = v2.4.9
+url = https://github.com/red0124/doctest
+revision = master
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 4fb516f..60078c0 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -4,11 +4,6 @@ project(ssp_tests CXX)
 
 # ---- Dependencies ----
 
-set(SSP_INCLUDE_WITHOUT_SYSTEM YES
-    CACHE INTERNAL
-    "Turn the warning guard off to have errors appear in test builds"
-)
-
 include(FetchContent)
 fetchcontent_declare(ssp SOURCE_DIR "${PROJECT_SOURCE_DIR}/..")
 fetchcontent_makeavailable(ssp)
@@ -17,9 +12,16 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
     target_compile_options(ssp INTERFACE -Wall -Wextra)
 endif()
 
-find_package(doctest 2.4.4 CONFIG REQUIRED)
-# for doctest_discover_tests
-include(doctest)
+include(FetchContent)
+fetchcontent_declare(
+    DOCTEST
+    GIT_REPOSITORY https://github.com/red0124/doctest
+    GIT_TAG origin/master
+    GIT_SHALLOW TRUE
+)
+
+fetchcontent_makeavailable(DOCTEST)
+set(DOCTEST "${FETCHCONTENT_BASE_DIR}/doctest-src")
 
 # ---- Test ----
 
@@ -35,5 +37,5 @@ foreach(name IN ITEMS test_splitter test_parser test_converter test_extractions)
         "${name}"
         PRIVATE DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN CMAKE_GITHUB_CI
     )
-    doctest_discover_tests("${name}")
+    add_test(NAME "${name}" COMMAND "${name}")
 endforeach()