aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt3
-rw-r--r--kernel/CMakeLists.txt3
-rw-r--r--libs/acpi/CMakeLists.txt26
-rw-r--r--libs/elf/CMakeLists.txt21
-rw-r--r--libs/kstd/CMakeLists.txt24
-rw-r--r--libs/multiboot2/CMakeLists.txt21
6 files changed, 10 insertions, 88 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8118e0f..f7c7fe8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,9 +31,6 @@ if (BUILD_TESTING)
FetchContent_MakeAvailable("Catch2")
- find_package("Catch2")
- include("Catch")
-
add_compile_definitions("CATCH_CONFIG_NO_COUNTER")
set(CATCH_TEST_ARGS "EXTRA_ARGS" "--reporter" "junit::out=junit.xml" "--reporter" "console::out=-::colour-mode=ansi")
endif()
diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt
index 2ce9621..cbc7fa5 100644
--- a/kernel/CMakeLists.txt
+++ b/kernel/CMakeLists.txt
@@ -137,6 +137,9 @@ endif()
#]============================================================================]
if(BUILD_TESTING)
+ find_package("Catch2")
+ include("Catch")
+
enable_coverage("kernel_lib")
add_executable("kernel_tests")
diff --git a/libs/acpi/CMakeLists.txt b/libs/acpi/CMakeLists.txt
index 135ce6a..1d03bb5 100644
--- a/libs/acpi/CMakeLists.txt
+++ b/libs/acpi/CMakeLists.txt
@@ -9,27 +9,6 @@ project("acpi"
include("CTest")
#[============================================================================[
-# External Dependencies
-#]============================================================================]
-
-include("FetchContent")
-
-if (BUILD_TESTING)
- FetchContent_Declare(
- "Catch2"
- URL "https://github.com/catchorg/Catch2/archive/refs/tags/v3.7.1.tar.gz"
- URL_HASH "SHA256=c991b247a1a0d7bb9c39aa35faf0fe9e19764213f28ffba3109388e62ee0269c"
- EXCLUDE_FROM_ALL
- FIND_PACKAGE_ARGS
- )
-
- FetchContent_MakeAvailable("Catch2")
-
- find_package("Catch2")
- include("Catch")
-endif()
-
-#[============================================================================[
# Library
#]============================================================================]
@@ -75,6 +54,9 @@ set_target_properties("acpi" PROPERTIES
#]============================================================================]
if(BUILD_TESTING)
+ find_package("Catch2")
+ include("Catch")
+
find_program(IASL_EXE NAMES "iasl" REQUIRED)
set(TEST_TABLES
@@ -132,5 +114,5 @@ if(BUILD_TESTING)
EXCLUDE_FROM_ALL NO
)
- catch_discover_tests("acpi_tests" ${CATCH_TEST_ARGS})
+ catch_discover_tests("acpi::tests" ${CATCH_TEST_ARGS})
endif()
diff --git a/libs/elf/CMakeLists.txt b/libs/elf/CMakeLists.txt
index 22ca200..1841132 100644
--- a/libs/elf/CMakeLists.txt
+++ b/libs/elf/CMakeLists.txt
@@ -9,27 +9,6 @@ project("elf"
include("CTest")
#[============================================================================[
-# External Dependencies
-#]============================================================================]
-
-include("FetchContent")
-
-if (BUILD_TESTING)
- FetchContent_Declare(
- "Catch2"
- URL "https://github.com/catchorg/Catch2/archive/refs/tags/v3.7.1.tar.gz"
- URL_HASH "SHA256=c991b247a1a0d7bb9c39aa35faf0fe9e19764213f28ffba3109388e62ee0269c"
- EXCLUDE_FROM_ALL
- FIND_PACKAGE_ARGS
- )
-
- FetchContent_MakeAvailable("Catch2")
-
- find_package("Catch2")
- include("Catch")
-endif()
-
-#[============================================================================[
# Library
#]============================================================================]
diff --git a/libs/kstd/CMakeLists.txt b/libs/kstd/CMakeLists.txt
index 1cc75b7..0f64761 100644
--- a/libs/kstd/CMakeLists.txt
+++ b/libs/kstd/CMakeLists.txt
@@ -9,27 +9,6 @@ project("kstd"
include("CTest")
#[============================================================================[
-# External Dependencies
-#]============================================================================]
-
-include("FetchContent")
-
-if (BUILD_TESTING)
- FetchContent_Declare(
- "Catch2"
- URL "https://github.com/catchorg/Catch2/archive/refs/tags/v3.7.1.tar.gz"
- URL_HASH "SHA256=c991b247a1a0d7bb9c39aa35faf0fe9e19764213f28ffba3109388e62ee0269c"
- EXCLUDE_FROM_ALL
- FIND_PACKAGE_ARGS
- )
-
- FetchContent_MakeAvailable("Catch2")
-
- find_package("Catch2")
- include("Catch")
-endif()
-
-#[============================================================================[
# Library
#]============================================================================]
@@ -88,6 +67,9 @@ endif()
#]============================================================================]
if(BUILD_TESTING)
+ find_package("Catch2")
+ include("Catch")
+
add_executable("kstd_tests")
add_executable("kstd::tests" ALIAS "kstd_tests")
diff --git a/libs/multiboot2/CMakeLists.txt b/libs/multiboot2/CMakeLists.txt
index da5fb53..5ab56db 100644
--- a/libs/multiboot2/CMakeLists.txt
+++ b/libs/multiboot2/CMakeLists.txt
@@ -9,27 +9,6 @@ project("multiboot2"
include("CTest")
#[============================================================================[
-# External Dependencies
-#]============================================================================]
-
-include("FetchContent")
-
-if (BUILD_TESTING)
- FetchContent_Declare(
- "Catch2"
- URL "https://github.com/catchorg/Catch2/archive/refs/tags/v3.7.1.tar.gz"
- URL_HASH "SHA256=c991b247a1a0d7bb9c39aa35faf0fe9e19764213f28ffba3109388e62ee0269c"
- EXCLUDE_FROM_ALL
- FIND_PACKAGE_ARGS
- )
-
- FetchContent_MakeAvailable("Catch2")
-
- find_package("Catch2")
- include("Catch")
-endif()
-
-#[============================================================================[
# Library
#]============================================================================]