Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/Progmasoft/Catch3/Assertions.hpp
diff options
context:
space:
mode:
authorLeitwolf112026-09-24 23:05:47 +0300
committerLeitwolf112026-09-24 23:05:47 +0300
commitd79b294903e4d0f4b24fdf1cc50be4b0fec7f745 (patch)
tree64f0c7c3dfbc08bfb70d9a37df5cccae3d52b526 /src/Progmasoft/Catch3/Assertions.hpp
parent9ad804cedf4cc4a85ef89fe097f97a3b44654360 (diff)
downloadcatch3-0.2.0.tar.gz
Add snapshots and JUnit result serialization0.2.0
Diffstat (limited to 'src/Progmasoft/Catch3/Assertions.hpp')
-rw-r--r--src/Progmasoft/Catch3/Assertions.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Progmasoft/Catch3/Assertions.hpp b/src/Progmasoft/Catch3/Assertions.hpp
index 19ac13ef..668c086d 100644
--- a/src/Progmasoft/Catch3/Assertions.hpp
+++ b/src/Progmasoft/Catch3/Assertions.hpp
@@ -6,6 +6,7 @@
#include <catch2/catch_test_macros.hpp>
#include <Progmasoft/Catch3/Property.hpp>
+#include <Progmasoft/Catch3/Snapshot.hpp>
/// Runs a property and reports its replay seed and minimized counterexample.
#define CATCH3_CHECK_PROPERTY( ... ) \
@@ -15,3 +16,12 @@
INFO( catch3PropertyResult.Describe() ); \
CHECK( catch3PropertyResult.Succeeded() ); \
} while ( false )
+
+/// Compares a value with a named snapshot and reports the first difference.
+#define CATCH3_CHECK_SNAPSHOT( name, actual, options ) \
+ do { \
+ const auto catch3SnapshotResult = \
+ ::Progmasoft::Catch3::CompareSnapshot( name, actual, options ); \
+ INFO( catch3SnapshotResult.Message ); \
+ CHECK( catch3SnapshotResult.Succeeded() ); \
+ } while ( false )