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

Commit f77f1bf

Browse files
Update Catch2 to version 3.2.1
1 parent 89597ea commit f77f1bf

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
@@ -33,10 +33,6 @@ find_package(Catch2 CONFIG REQUIRED)
3333

3434
include(Catch)
3535

36-
add_library(catch_main OBJECT catch_main.cpp)
37-
target_link_libraries(catch_main PUBLIC Catch2::Catch2)
38-
target_link_libraries(catch_main PRIVATE myproject::project_options)
39-
4036
# Provide a simple smoke test to make sure that the CLI works and can display a --help message
4137
add_test(NAME cli.has_help COMMAND intro --help)
4238

@@ -48,7 +44,7 @@ add_test(NAME cli.version_matches COMMAND intro --version)
4844
set_tests_properties(cli.version_matches PROPERTIES PASS_REGULAR_EXPRESSION "${PROJECT_VERSION}")
4945

5046
add_executable(tests tests.cpp)
51-
target_link_libraries(tests PRIVATE myproject::project_warnings myproject::project_options catch_main)
47+
target_link_libraries(tests PRIVATE myproject::project_warnings myproject::project_options Catch2::Catch2WithMain)
5248

5349
# automatically discover tests that are defined in catch based test files you can modify the unittests. Set TEST_PREFIX
5450
# to whatever you want, or use different for different binaries
@@ -57,7 +53,7 @@ catch_discover_tests(
5753
TEST_PREFIX
5854
"unittests."
5955
REPORTER
60-
xml
56+
XML
6157
OUTPUT_DIR
6258
.
6359
OUTPUT_PREFIX
@@ -67,14 +63,14 @@ catch_discover_tests(
6763

6864
# Add a file containing a set of constexpr tests
6965
add_executable(constexpr_tests constexpr_tests.cpp)
70-
target_link_libraries(constexpr_tests PRIVATE myproject::project_options myproject::project_warnings catch_main)
66+
target_link_libraries(constexpr_tests PRIVATE myproject::project_options myproject::project_warnings Catch2::Catch2WithMain)
7167

7268
catch_discover_tests(
7369
constexpr_tests
7470
TEST_PREFIX
7571
"constexpr."
7672
REPORTER
77-
xml
73+
XML
7874
OUTPUT_DIR
7975
.
8076
OUTPUT_PREFIX
@@ -85,15 +81,15 @@ catch_discover_tests(
8581
# Disable the constexpr portion of the test, and build again this allows us to have an executable that we can debug when
8682
# things go wrong with the constexpr testing
8783
add_executable(relaxed_constexpr_tests constexpr_tests.cpp)
88-
target_link_libraries(relaxed_constexpr_tests PRIVATE myproject::project_options myproject::project_warnings catch_main)
84+
target_link_libraries(relaxed_constexpr_tests PRIVATE myproject::project_options myproject::project_warnings Catch2::Catch2WithMain)
8985
target_compile_definitions(relaxed_constexpr_tests PRIVATE -DCATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
9086

9187
catch_discover_tests(
9288
relaxed_constexpr_tests
9389
TEST_PREFIX
9490
"relaxed_constexpr."
9591
REPORTER
96-
xml
92+
XML
9793
OUTPUT_DIR
9894
.
9995
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)