Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.

Commit 6c2e63e

Browse files
Update Catch2 to version 3.2.1
1 parent 5bdc542 commit 6c2e63e

File tree

5 files changed

+9
-16
lines changed

5 files changed

+9
-16
lines changed

conanfile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Docs at https://docs.conan.io/en/latest/reference/conanfile_txt.html
22

33
[requires]
4-
catch2/2.13.9
4+
catch2/3.2.1
55
cli11/2.2.0
66
spdlog/1.10.0
77

test/CMakeLists.txt

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ find_package(Catch2 CONFIG REQUIRED)
2121

2222
include(Catch)
2323

24-
add_library(catch_main OBJECT catch_main.cpp)
25-
target_link_libraries(catch_main PUBLIC Catch2::Catch2)
26-
target_link_libraries(catch_main PRIVATE myproject::project_options)
27-
2824
# Provide a simple smoke test to make sure that the CLI works and can display a --help message
2925
add_test(NAME cli.has_help COMMAND intro --help)
3026

@@ -36,7 +32,7 @@ add_test(NAME cli.version_matches COMMAND intro --version)
3632
set_tests_properties(cli.version_matches PROPERTIES PASS_REGULAR_EXPRESSION "${PROJECT_VERSION}")
3733

3834
add_executable(tests tests.cpp)
39-
target_link_libraries(tests PRIVATE myproject::project_warnings myproject::project_options catch_main)
35+
target_link_libraries(tests PRIVATE myproject::project_warnings myproject::project_options Catch2::Catch2WithMain)
4036

4137
# automatically discover tests that are defined in catch based test files you can modify the unittests. Set TEST_PREFIX
4238
# to whatever you want, or use different for different binaries
@@ -45,7 +41,7 @@ catch_discover_tests(
4541
TEST_PREFIX
4642
"unittests."
4743
REPORTER
48-
xml
44+
XML
4945
OUTPUT_DIR
5046
.
5147
OUTPUT_PREFIX
@@ -55,14 +51,14 @@ catch_discover_tests(
5551

5652
# Add a file containing a set of constexpr tests
5753
add_executable(constexpr_tests constexpr_tests.cpp)
58-
target_link_libraries(constexpr_tests PRIVATE myproject::project_options myproject::project_warnings catch_main)
54+
target_link_libraries(constexpr_tests PRIVATE myproject::project_options myproject::project_warnings Catch2::Catch2WithMain)
5955

6056
catch_discover_tests(
6157
constexpr_tests
6258
TEST_PREFIX
6359
"constexpr."
6460
REPORTER
65-
xml
61+
XML
6662
OUTPUT_DIR
6763
.
6864
OUTPUT_PREFIX
@@ -73,15 +69,15 @@ catch_discover_tests(
7369
# Disable the constexpr portion of the test, and build again this allows us to have an executable that we can debug when
7470
# things go wrong with the constexpr testing
7571
add_executable(relaxed_constexpr_tests constexpr_tests.cpp)
76-
target_link_libraries(relaxed_constexpr_tests PRIVATE myproject::project_options myproject::project_warnings catch_main)
72+
target_link_libraries(relaxed_constexpr_tests PRIVATE myproject::project_options myproject::project_warnings Catch2::Catch2WithMain)
7773
target_compile_definitions(relaxed_constexpr_tests PRIVATE -DCATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
7874

7975
catch_discover_tests(
8076
relaxed_constexpr_tests
8177
TEST_PREFIX
8278
"relaxed_constexpr."
8379
REPORTER
84-
xml
80+
XML
8581
OUTPUT_DIR
8682
.
8783
OUTPUT_PREFIX

test/catch_main.cpp

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/constexpr_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <catch2/catch.hpp>
1+
#include <catch2/catch_test_macros.hpp>
22

33
constexpr unsigned int Factorial(unsigned int number)// NOLINT(misc-no-recursion)
44
{

test/tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <catch2/catch.hpp>
1+
#include <catch2/catch_test_macros.hpp>
22

33
unsigned int Factorial(unsigned int number)// NOLINT(misc-no-recursion)
44
{

0 commit comments

Comments
 (0)