Skip to content

Commit e4cdd8b

Browse files
committed
Update to Catch 3.x (#190)
1 parent 172da85 commit e4cdd8b

7 files changed

Lines changed: 6 additions & 33 deletions

File tree

conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ScopeguardConan(ConanFile):
2424
"enable_compat_header=OFF"
2525
)
2626
__requirements = [
27-
"catch2/2.13.9",
27+
"catch2/3.0.1",
2828
"trompeloeil/42"
2929
]
3030

test/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
find_package(Catch2 REQUIRED)
22
find_package(trompeloeil REQUIRED)
33

4-
add_library(TestMain TestMain.cpp)
5-
target_link_libraries(TestMain PUBLIC Catch2::Catch2 trompeloeil::trompeloeil)
6-
74

85
function(add_test_suite name)
96
add_executable(${name} ${name}.cpp)
10-
target_link_libraries(${name} PRIVATE TestMain ScopeGuard)
7+
target_link_libraries(${name} PRIVATE Catch2::Catch2WithMain trompeloeil::trompeloeil ScopeGuard)
118
add_test(${name} ${name})
129
endfunction()
1310

test/ScopeExitTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include "scope_exit.h"
2424
#include "CallMocks.h"
25-
#include <catch2/catch.hpp>
25+
#include <catch2/catch_test_macros.hpp>
2626

2727
namespace
2828
{

test/ScopeFailTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include "scope_fail.h"
2424
#include "CallMocks.h"
25-
#include <catch2/catch.hpp>
25+
#include <catch2/catch_test_macros.hpp>
2626

2727
namespace
2828
{

test/ScopeSuccessTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include "scope_success.h"
2424
#include "CallMocks.h"
25-
#include <catch2/catch.hpp>
25+
#include <catch2/catch_test_macros.hpp>
2626

2727
namespace
2828
{

test/TestMain.cpp

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

test/UniqueResourceTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include "unique_resource.h"
2424
#include "CallMocks.h"
25-
#include <catch2/catch.hpp>
25+
#include <catch2/catch_test_macros.hpp>
2626
#include <trompeloeil.hpp>
2727

2828
namespace

0 commit comments

Comments
 (0)