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

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorMartin Hořeňovský2017-02-15 10:35:01 +0100
committerMartin Hořeňovský2017-02-15 10:35:01 +0100
commit3cfef738e7a0ca6aa70f9a06bc3a278b834051ef (patch)
treebd36fc170db6e5dec17d20d87e8524e691e0eebf /include
parent5cb9e4703400915a3ba4fa986fffb7af1652ee9d (diff)
parent7b13a8f85a0fb7d99759591b01539d6d0202f383 (diff)
downloadcatch3-3cfef738e7a0ca6aa70f9a06bc3a278b834051ef.tar.gz
Merge branch 'dev-performance-round3'
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_capture.hpp11
-rw-r--r--include/internal/catch_result_builder.hpp9
2 files changed, 19 insertions, 1 deletions
diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp
index 8abc536b..0ffe5b9a 100644
--- a/include/internal/catch_capture.hpp
+++ b/include/internal/catch_capture.hpp
@@ -19,6 +19,14 @@
#include "catch_type_traits.hpp"
+#if defined(CATCH_CONFIG_FAST_COMPILE)
+///////////////////////////////////////////////////////////////////////////////
+// We can speedup compilation significantly by breaking into debugger lower in
+// the callstack, because then we don't have to expand CATCH_BREAK_INTO_DEBUGGER
+// macro in each assertion
+#define INTERNAL_CATCH_REACT( resultBuilder ) \
+ resultBuilder.react();
+#else
///////////////////////////////////////////////////////////////////////////////
// In the event of a failure works out if the debugger needs to be invoked
// and/or an exception thrown and takes appropriate action.
@@ -26,7 +34,8 @@
// source code rather than in Catch library code
#define INTERNAL_CATCH_REACT( resultBuilder ) \
if( resultBuilder.shouldDebugBreak() ) CATCH_BREAK_INTO_DEBUGGER(); \
- resultBuilder.react();
+ resultBuilder.react();
+#endif
///////////////////////////////////////////////////////////////////////////////
diff --git a/include/internal/catch_result_builder.hpp b/include/internal/catch_result_builder.hpp
index f0c7b631..aaa37a8a 100644
--- a/include/internal/catch_result_builder.hpp
+++ b/include/internal/catch_result_builder.hpp
@@ -100,6 +100,15 @@ namespace Catch {
}
void ResultBuilder::react() {
+#if defined(CATCH_CONFIG_FAST_COMPILE)
+ if (m_shouldDebugBreak) {
+ ///////////////////////////////////////////////////////////////////
+ // To inspect the state during test, you need to go one level up the callstack
+ // To go back to the test and change execution, jump over the throw statement
+ ///////////////////////////////////////////////////////////////////
+ CATCH_BREAK_INTO_DEBUGGER();
+ }
+#endif
if( m_shouldThrow )
throw Catch::TestFailureException();
}