Commit Graph

20 Commits

Author SHA1 Message Date
Neal Coombes a53ea30723 Eliminate some work when results won't be reported. 2017-07-07 01:34:12 +02:00
Neal Coombes 396ecf6021 Cache std::ostringstream between assertions.
This is not thread safe, but I think that was already true of Catch.
The construction/destruction of the std::ostringstream is where the
vast majority of time is spent per assertion.  A simple test of
100000000 CHECK()s is reduced from around 60s to 7.4s
2017-06-25 15:53:59 +02:00
Neal Coombes dcab8a5971 Performance improvement in AssertionInfo.
By using char const * instead of std::string we avoid significant
copying per assertion.  In a simple loop with 10000000 CHECKS on
my system, this reduces the run time from 9.8s to 6s.
2017-06-22 18:03:47 +02:00
Martin Hořeňovský 95d85fb186 Fixed up CATCH_CONFIG_FAST_COMPILE for REQUIREs
Unexpected exceptions no longer cause abort and there should be no more
potential for false negatives.

The trade-off now is that exceptions are no longer translated.
2017-04-03 11:36:55 +02:00
Martin Hořeňovský 4fe2432e05 Rework of REQUIRE* changes in CATCH_CONFIG_FAST_COMPILE
`ResultBuilder`s destructor now checks for exceptions, preventing false
negatives. The speedup should remain the same give or take a tiny bit.
2017-03-29 21:12:06 +02:00
Martin Hořeňovský 3cfef738e7 Merge branch 'dev-performance-round3' 2017-02-15 10:35:01 +01:00
Martin Hořeňovský 7b13a8f85a Move debug break out of tests, speeds up compilation time
This is hidden behind CATCH_CONFIG_FAST_COMPILE
2017-02-14 15:35:12 +01:00
Phil Nash 7fed25ad1f New Matchers implementation
- simpler
- less templates and machinery
- no cloning, copying or unnecessary heap allocations
- better factored
2017-02-14 09:16:54 +00:00
Phil Nash 2b74613c54 Revert "First cut of Evaluate refactoring to remove int specialisations, among other things"
This reverts commit 39753558eb.
2017-02-06 22:37:23 +00:00
Phil Nash 39753558eb First cut of Evaluate refactoring to remove int specialisations, among other things 2017-02-06 15:15:43 +00:00
Mickey Rose a1e9b841ff lazily stringify expressions 2017-01-14 21:56:16 +01:00
Ross Bencina 7255be28cc remove concatenation of m_exprComponents.op in if-branch where op has tested empty in previous line 2017-01-07 13:37:08 +01:00
Phil Nash e91738103c Stripped trailing whitespace from all source code lines
(replaces need for PRs #310 and #504)
2015-11-04 18:04:15 +00:00
Phil Nash 72868920bb Exception message assertions now work with matchers 2015-07-15 23:02:25 +01:00
Phil Nash 2104ca2aa4 Exception message testing now supports wildcards
- extracted WildcardPattern from TestSpec::NamePattern
2015-07-13 15:03:04 +01:00
Phil Nash 85de743d70 Added _THROWS_WITH macros
- asserts on exception message
2015-07-13 06:34:41 +01:00
Baruch 465454fecc Fix REQUIRE_FALSE so that it aborts test case 2015-04-29 13:54:47 +03:00
Phil Nash be9fe76101 Renamed ShouldNegate to FalseTest 2014-05-29 08:00:20 +01:00
Phil Nash 10801c2876 Folded ExpressionResultBuilder into ResultBuilder
(even more SRP violations!)
2014-05-29 07:50:19 +01:00
Phil Nash 9438a03d5b Big assertion capture refactoring.
- moved as much logic out of the macros as possible
- moved most logic into new ResultBuilder class, which wraps ExpressionResultBuilder (may take it over next), subsumes ResultAction and also takes place of ExpressionDecomposer.

This introduces many SRP violations - but all in the name of minimising macro logic!
2014-05-28 18:53:01 +01:00