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

Commit c55d340

Browse files
Update Catch2 to version 3.2.1
1 parent 9f45cc4 commit c55d340

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

2929
include(Catch)
3030

31-
add_library(catch_main OBJECT catch_main.cpp)
32-
target_link_libraries(catch_main PUBLIC Catch2::Catch2)
33-
target_link_libraries(catch_main PRIVATE myproject::project_options)
34-
3531
# Provide a simple smoke test to make sure that the CLI works and can display a --help message
3632
add_test(NAME cli.has_help COMMAND intro --help)
3733

@@ -43,7 +39,7 @@ add_test(NAME cli.version_matches COMMAND intro --version)
4339
set_tests_properties(cli.version_matches PROPERTIES PASS_REGULAR_EXPRESSION "${PROJECT_VERSION}")
4440

4541
add_executable(tests tests.cpp)
46-
target_link_libraries(tests PRIVATE myproject::project_warnings myproject::project_options catch_main)
42+
target_link_libraries(tests PRIVATE myproject::project_warnings myproject::project_options Catch2::Catch2WithMain)
4743

4844
# automatically discover tests that are defined in catch based test files you can modify the unittests. Set TEST_PREFIX
4945
# to whatever you want, or use different for different binaries
@@ -52,7 +48,7 @@ catch_discover_tests(
5248
TEST_PREFIX
5349
"unittests."
5450
REPORTER
55-
xml
51+
XML
5652
OUTPUT_DIR
5753
.
5854
OUTPUT_PREFIX
@@ -62,14 +58,14 @@ catch_discover_tests(
6258

6359
# Add a file containing a set of constexpr tests
6460
add_executable(constexpr_tests constexpr_tests.cpp)
65-
target_link_libraries(constexpr_tests PRIVATE myproject::project_options myproject::project_warnings catch_main)
61+
target_link_libraries(constexpr_tests PRIVATE myproject::project_options myproject::project_warnings Catch2::Catch2WithMain)
6662

6763
catch_discover_tests(
6864
constexpr_tests
6965
TEST_PREFIX
7066
"constexpr."
7167
REPORTER
72-
xml
68+
XML
7369
OUTPUT_DIR
7470
.
7571
OUTPUT_PREFIX
@@ -80,15 +76,15 @@ catch_discover_tests(
8076
# Disable the constexpr portion of the test, and build again this allows us to have an executable that we can debug when
8177
# things go wrong with the constexpr testing
8278
add_executable(relaxed_constexpr_tests constexpr_tests.cpp)
83-
target_link_libraries(relaxed_constexpr_tests PRIVATE myproject::project_options myproject::project_warnings catch_main)
79+
target_link_libraries(relaxed_constexpr_tests PRIVATE myproject::project_options myproject::project_warnings Catch2::Catch2WithMain)
8480
target_compile_definitions(relaxed_constexpr_tests PRIVATE -DCATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
8581

8682
catch_discover_tests(
8783
relaxed_constexpr_tests
8884
TEST_PREFIX
8985
"relaxed_constexpr."
9086
REPORTER
91-
xml
87+
XML
9288
OUTPUT_DIR
9389
.
9490
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)