Skip to content

Commit a3981a0

Browse files
committed
Include Catch2 header directly in repository
Bundle catch.hpp (v2.13.10) to avoid having to install an old release. Update all test files to use the local header.
1 parent b03e367 commit a3981a0

18 files changed

Lines changed: 17991 additions & 28 deletions

.github/workflows/ci.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,6 @@ jobs:
139139
boost:p
140140
fmt:p
141141
${{ matrix.sys != 'mingw32' && 'range-v3:p' || '' }}
142-
- name: setup catch2
143-
run: |
144-
mkdir -p cmake/catch2
145-
curl -L -o cmake/catch2/catch.hpp https://github.com/catchorg/Catch2/releases/download/v2.13.10/catch.hpp
146-
cat > cmake/FindCatch2.cmake << 'EOF'
147-
add_library(Catch2::Catch2 INTERFACE IMPORTED)
148-
set_target_properties(Catch2::Catch2 PROPERTIES
149-
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}"
150-
)
151-
set(Catch2_FOUND TRUE)
152-
EOF
153142
- name: build
154143
run: |
155144
cmake . -G Ninja -DCMAKE_MODULE_PATH=$(pwd)/cmake -DENABLE_RANGE_V3=${{ matrix.range_v3 }} -DENABLE_FMT=ON -DBUILD_TESTING=ON -DCMAKE_CXX_STANDARD=${{ matrix.cpp }} -DCMAKE_CXX_FLAGS='-Wall -Wextra -Wconversion -Wshadow -pedantic -Werror -Wno-c2y-extensions' -DCMAKE_BUILD_TYPE=Release

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@
5151
nativeBuildInputs = with pkgs.buildPackages; [
5252
(fmt.override { inherit stdenv; })
5353
boost
54-
catch2
5554
clang-tools
5655
cmakeCurses
5756
conan
5857
range-v3
5958
] ++ app.nativeBuildInputs;
59+
hardeningDisable = [ "fortify" ];
6060
};
6161

6262
in {

tests/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ endif()
55
option(ENABLE_RANGE_V3 "If ON the tests to Range-v3 library will be enabled" OFF)
66
option(ENABLE_FMT "If ON the tests to {fmt} library will be enabled" OFF)
77

8-
find_package(Catch2 REQUIRED)
98
find_package(Boost REQUIRED)
109

1110
if (ENABLE_RANGE_V3)
@@ -26,7 +25,7 @@ include_directories(${PROJECT_SOURCE_DIR})
2625
function(declare_test name)
2726
add_executable(test_${name} test_${name}.cpp)
2827
add_test(NAME test_${name} COMMAND test_${name})
29-
target_link_libraries(test_${name} PRIVATE Catch2::Catch2 Boost::headers)
28+
target_link_libraries(test_${name} PRIVATE Boost::headers)
3029

3130
if (ENABLE_RANGE_V3)
3231
target_link_libraries(test_${name} PRIVATE range-v3::range-v3)

0 commit comments

Comments
 (0)