Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

. d Minor addition for catch2_amalgamated #232

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions doc/UsingCatch2v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,43 @@ Create a file `main.cpp` and add just the following two lines:

<!-- todo: document use of sections -->

### Using an amalgamated release

Catch2 distributes amalgamated releases, which need a slight modification in the
`.hpp` file.

<!-- snippet: catch_2_v3_main -->
<a id='snippet-catch_2_v3_amalgam_diff></a>
```diff
diff --git a/client/thirdparty/ApprovalTests.hpp b/client/thirdparty/ApprovalTests.hpp
index 35199074..025c94e6 100644
--- a/client/thirdparty/ApprovalTests.hpp
+++ b/client/thirdparty/ApprovalTests.hpp
@@ -2235,7 +2235,7 @@ namespace ApprovalTests
#ifdef APPROVALS_CATCH
#define APPROVAL_TESTS_INCLUDE_CPPS

-#include "catch2/catch_amalgamated.hpp"
+#include <catch2/catch.hpp>

//namespace ApprovalTests {
struct Catch2ApprovalListener : Catch::TestEventListenerBase
@@ -2307,7 +2307,10 @@ CATCH_REGISTER_LISTENER(Catch2TestCommitRevert)
#ifdef APPROVALS_CATCH2_V3
#define APPROVAL_TESTS_INCLUDE_CPPS

-#include "catch2/catch_amalgamated.hpp"
+#include <catch2/reporters/catch_reporter_event_listener.hpp>
+#include <catch2/catch_test_macros.hpp>
+#include <catch2/reporters/catch_reporter_registrars.hpp>
+#include <catch2/catch_test_case_info.hpp>

//namespace ApprovalTests {
struct Catch2ApprovalListener : Catch::EventListenerBase
```
<sup><a href='/tests/Catch2v3_Tests/amalgamated.diff' title='Diff source file'>snippet source</a> | <a href='#snippet-catch_2_v3_difftitle='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

### Existing Project - with your main()

If you have [supplied your own `main()` for Catch](https://github.com/catchorg/Catch2/blob/master/docs/own-main.md#top), you will need to teach it how to supply test names to Approval Tests.
Expand Down
Loading